标签:objective-c
初始化-(id)init { self =[super init]; if (self!=nil) { _XXX=XXX; } return self; }可以这样写
-(id)init { if (self=[super init]) { _XXX=XXX; } return self; }如果自定义init函数,比如要传参数,需要在h中声明
-(id)initWithName:(NString *)name
转载请注明源地址 http://blog.csdn.net/fried_potatoes
标签:objective-c
原文地址:http://blog.csdn.net/fried_potatoes/article/details/42105135