我习惯于拥有垃圾收集器的ASP.NET。但是在进入MonoTouch和iPhone编程后,我在运行我的应用程序时发现了很多这些消息。
我是否忽略它们,还是应该在每个viewcontroller中实现某种卸载方法来处理对象?
当我将我的应用程序提交给iTunes时,这是苹果公司会看到的东西(我还没有这样做)吗?
2011-02-12 20:58:55.641 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0xfd34dd0 of class NSPathStore2 autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.648 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0xfd3a710 of class NSPathStore2 autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.649 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0xfd3a830 of class NSPathStore2 autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.650 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0xfd3bae0 of class NSPathStore2 autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.651 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0xce8a520 of class NSPathStore2 autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.651 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0xce8a5e0 of class NSPathStore2 autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.658 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0x7bccd40 of class __NSArrayReverseEnumerator autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.659 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0x7bce550 of class __NSArrayI autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.659 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0x7bce550 of class __NSArrayI autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.660 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0xce8f280 of class NSIndexPath autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.664 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0xce90480 of class __NSCFData autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.664 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0xce90690 of class UICFFont autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.670 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0xce91c30 of class NSIndexPath autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.671 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0xfd3a840 of class NSIndexPath autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.673 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0x7bcc550 of class CAlertView autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.674 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0xce91ca0 of class __NSArrayM autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.675 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0x6e87c10 of class _UIAlertOverlayWindow autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.675 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0xce90a50 of class UIInputViewSet autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.676 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0xce90a60 of class UIInputViewAnimationStyle autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.676 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0xce93bf0 of class CABasicAnimation autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.677 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0xce93c00 of class NSCFNumber autoreleased with no pool in place - just leaking 2011-02-12 20:58:55.677 wps[1200:7803] *** __NSAutoreleaseNoPool(): Object 0xce93a10 of class __NSCFDictionary autoreleased with no pool in place - just leaking
答案 0 :(得分:6)
您正在显式创建的(非线程池)线程上创建NSObject。你必须将线程包装在
中using (var pool = new NSAutoreleasePool ()) {
// thread work goes here
}