Why zone is always nil while implementing NSCopying?

前端 未结 5 1429
慢半拍i
慢半拍i 2021-02-13 04:47

It may be simple question, but why implementing NSCopying protocol in my class, I get zone == nil

- (id)copyWithZone:(NSZone *)zone
{
    if (zo         


        
5条回答
  •  面向向阳花
    2021-02-13 05:21

    NSZone was deprecated a long time ago. The fact that it's still in method signatures (e.g. +allocWithZone: and -copyWithZone:) are for backwards compatibility.

提交回复
热议问题