ios对象copy的方法,要实现nscopy协议
ios对象copy的方法,要实现nscopy协议
ios对象copy的方法,要实现nscopy协议
by 伍雪颖- (id)copyWithZone:(NSZone *)zone { RestEntity *copy = [[[self class] allocWithZone:zone] init]; copy.dishId = _dishId; return copy; } - (id)mutableCopyWithZone:(NSZone *)zone { RestEntity *copy = [RestEntity allocWithZone:zone]; copy.dishId = _dishId; return copy; }
NSObject
评论关闭