iOS5 ARC应用程序:__ NSAutoreleaseNoPool():类NSCFNumber自动释放,没有池到位 - 只是泄漏

kes*_*rut 2 iphone ios automatic-ref-counting

我最近为我的应用项目切换到ARC.我正在使用iOS 5 SDK.运行一台iPod 4g设备我没有收到任何警告.但是试图在iPod 2g上运行我的应用程序我收到很多警告:

*** __NSAutoreleaseNoPool(): Object 0x258070 of class DataModel autoreleased with no pool in place - just leaking
*** __NSAutoreleaseNoPool(): Object 0x2530a0 of class __NSArrayM autoreleased with no pool in place - just leaking
*** __NSAutoreleaseNoPool(): Object 0x25a2e0 of class NSCFNumber autoreleased with no pool in place - just leaking
Run Code Online (Sandbox Code Playgroud)

我想使用ARC运行arm6/arm7代码之间存在差异.

如何解决这个问题?谢谢

Mic*_*ann 5

无论你在一个单独的线程上做什么,添加@autoreleasepool上下文都很聪明.

更多信息请点击此处.

在这个相关问题中也有一些不错的例子.