iOS 多线程,ARC

iOS自己创建的线程需要自己定时的创建autorelease pools,否则对象不能及时自动释放。

方法1是不对的,while中的对象会无法及时释放。

1:
-(void)Thread{ @autoreleasepool { while(1){ } } } 2: -(void)Thread{ while (1) { @autoreleasepool { } } }

https://developer.apple.com/documentation/foundation/nsautoreleasepool 

原文地址:https://www.cnblogs.com/mlj318/p/7465012.html