错误如下:

‘NSAutoreleasePool‘ is unavailable: not available in automatic reference counting mode 解决_解决方案

出现上面错误原因是因为NSAutoreleasePool不支持在ARC模式下使用.

官方说明如下:

‘NSAutoreleasePool‘ is unavailable: not available in automatic reference counting mode 解决_objective-c_02

 解决方案: 

在工程中禁用ARC

‘NSAutoreleasePool‘ is unavailable: not available in automatic reference counting mode 解决_解决方案_03

关闭ARC后错误消失 

‘NSAutoreleasePool‘ is unavailable: not available in automatic reference counting mode 解决_解决方案_04

 

@autoreleasepool 不管ARC是否开启或者禁用都可用,建义使用@autoreleasepool块来代替NSAutoreleasePool