Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Arguments for a copy method versus a copy constructor in Objective-C
- @interface MyClass : NSObject <NSCopying>
- -(id)copyWithZone:(NSZone*)zone {
- MyClass *copy = [[[self class] allocWithZone: zone] init];
- copy.user = self.user;
- copy.password = self.password;
- // etc
- return copy;
- }
Add Comment
Please, Sign In to add comment