注意從數(shù)組中拿數(shù)據(jù)傳輸,地址傳遞造成的原數(shù)據(jù)污染!
自定義對(duì)象的深拷貝要實(shí)現(xiàn)NSCoping方法。
@interface CustomerListCellInfoObject : NSObject <NSCopying>
//自定義對(duì)象的深拷貝
-(id)copyWithZone:(NSZone *)zone
{
CustomerListCellInfoObject *customer = [[[self class] allocWithZone:zone]init];
customer.cname = self.cname;
customer.ctel1 = self.ctel1;
customer.ctel2 = self.ctel2;
customer.attitude = self.attitude;
customer.icon = self.icon;
customer.lid = self.lid;
customer.cnameFirstChat = self.cnameFirstChat;
return customer;
}