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 オブジェクトが 1 つあると仮定します。
オーバーライドする必要があるクラスをサブクラス化しますcopyWithZone:。
copyWithZone:
サブクラスは、以下のようなメソッドを使用する必要があります。
- (id)copyWithZone:(NSZone *)zone { YourClass *copy = [[YourClass alloc] initWith...:<value>]; return copy; }