摘要: 不是所有的对象都支持 copy需要继承NSCopying 协议(实现 copyWithZone: 方法)同样,需要继承NSMutableCopying 协议才可以使用mutableCopy(实现 mutableCopyWithZone: 方法)默认 NSObject没有实现这两个协议,但是 copy和mutableCopy这两个方法是NSObject定义的这里要列举范例//1.h@interface CommonObj : NSObject@end@interface MyCObj : NSObject@property (nonatomic ,copy) CommonObj *obj;@en 阅读全文
posted @ 2013-11-19 23:49 菁菁工作室 阅读(272) 评论(0) 推荐(0) 编辑
摘要: Archiving Objective-C Objects with NSCodingFor the seasoned Cocoa developer, this is a piece of cake. For newer developers, this can be a real pain, especially if you don’t know what you’re looking for. I get this question a decent amount, so I figured I’d put a quick guide together.The ProblemYou c 阅读全文
posted @ 2013-11-19 23:30 菁菁工作室 阅读(265) 评论(0) 推荐(0) 编辑