- (id)copyWithZone:(NSZone *)zone
{
id copyObject = [[[self class] allocWithZone:zone] init];
unsigned int count = 0;
Ivar *ivars = class_copyIvarList([self class], &count);
for (int i = 0; i < count; i++)
{
NSString *key = [[NSString stringWithUTF8String:ivar_getName(ivars[i])] substringFromIndex:1];
[copyObject setValue:[self valueForKey:key] forKey:key];
}
return copyObject;
}
网友评论