Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人可以告诉我如何覆盖-copyWithZone:
-copyWithZone:
假设我有一个 NSString 对象, NSInteger 对象作为类成员。
子类化您需要覆盖的类copyWithZone:。
copyWithZone:
您的子类应使用类似于以下的方法:
- (id)copyWithZone:(NSZone *)zone { YourClass *copy = [[YourClass alloc] initWith...:<value>]; return copy; }