复制对象

对应的对象类实现 <NSCopying>

实现如下方法:

- (id)copyWithZone:(NSZone *)zone

{

    WeatherDomainData *weatherDomainData = [[WeatherDomainData allocWithZone:zone] init];

    weatherDomainData.domain=self.domain;

    weatherDomainData.level = self.level;

    weatherDomainData.isUsed = self.isUsed;

    return weatherDomainData;

}


你可能感兴趣的:(复制对象)