- (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 <NSCopying,NSMutableCopying>
原文地址:http://blog.csdn.net/rainlesvio/article/details/39202575