iOS - 自定义类方法/实例方法

+ (id)objWithJsonDic:(NSDictionary *)dic {
    return [[[self class] alloc] initWithJsonDic:dic];
}

- (id)initWithJsonDic:(NSDictionary*)dic {
    if (self = [self init]) {
        isInitSuccuss = NO;
        [self updateWithJsonDic:dic];
    }
    if (!isInitSuccuss) {
        self = nil;
        return nil;
    }
    return self;
}

你可能感兴趣的:(iOS - 自定义类方法/实例方法)