在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
先看代码: @interface ViewController() { NSObject * obj_; } @property(retain) NSObject * obj;//注意,默认是@property(atomic, .... @end @implementation ViewController @synthesize obj = obj_; - (id)init { if(self = [super init]) { obj_ = [[Obj alloc] init]; } int n = [obj_ retainCount]; id x = self.obj; int n2 = [obj_ retainCount]; // n2 与 n不相等? return self; } 结论: |
请发表评论