Guest User

Untitled

a guest
Aug 21st, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. Arguments for a copy method versus a copy constructor in Objective-C
  2. @interface MyClass : NSObject <NSCopying>
  3.  
  4. -(id)copyWithZone:(NSZone*)zone {
  5. MyClass *copy = [[[self class] allocWithZone: zone] init];
  6. copy.user = self.user;
  7. copy.password = self.password;
  8. // etc
  9.  
  10. return copy;
  11. }
Add Comment
Please, Sign In to add comment