实现拷贝的方法

2016-07-14  本文已影响6人  走道牙的人
@interface DBConfiguration : NSObject <NSCopying>
/** 包间配置 */
@property (nonatomic, strong) NSArray *roomConfigure;
/** 宴会类型 */
@property (nonatomic, strong) NSArray *banquetCategory;
/** 包间人数 */
@property (nonatomic, assign) NSInteger peopleNum;
/** 店铺配置 */
@property (nonatomic, strong) NSArray *shopConfigure;
@end

@implementation DBConfiguration
- (id)copyWithZone:(NSZone *)zone
{
    DBConfiguration *copy = [[DBConfiguration allocWithZone:zone] init];
    copy.roomConfigure = [self.roomConfigure copy];
    copy.banquetCategory = [self.banquetCategory copy];
    copy.peopleNum = self.peopleNum;
    copy.shopConfigure = [self.shopConfigure copy];
    return copy;
}
@end
上一篇 下一篇

猜你喜欢

热点阅读