84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
@autoreleasepool { NSObject *obj = [[NSObject alloc] init]; }
以上代码在ARC模式下,obj对该对象有强引用,一旦出了这个作用域,强引用失效,对象被销毁。同时该对象又被注册到autoreleasepool中,因为出了autoreleasepool的作用域,对象岂不是又要销毁一次???
认证高级PHP讲师
The scope of obj is the scope of the automatic release pool. It will not be used twice. After adding @autoreleasepool, the object is placed in the release pool
The scope of obj is the scope of the automatic release pool. It will not be used twice. After adding @autoreleasepool, the object is placed in the release pool