-(id)copyWithZone:(NSZone *)zone
{
Student * stu = [[Student allocWithZone:zone] init];
stu.name = self.name;
stu.age = self.age;
return stu;
}
-(id) myCopy
{
Student *stu = [Student new];
stu.name =self.name;
stu.age = self.age;
return stu;
}
http://blog.csdn.net/tskyfree/article/details/7999620
你调用任何类的copy和mutableCopy都会直接调用-(id)copyWithZone:(NSZone *)zone 这个等于是默认的