1
我的應用程序是ARC啓用的。*** __NSAutoreleaseNoPool():NSPathStore2類的對象0x926d620自動釋放,沒有到位池 - 只是泄漏
在應用程序委託我已經寫了代碼
[self performSelectorInBackground:@selector(initializeAnimationImageArrays) withObject:nil];
而且我的方法是
- (void)initializeAnimationImageArrays
{
NSArray *animationArray = [NSArray arrayWithObjects:
[UIImage imageNamed:@"1.png"],
[UIImage imageNamed:@"2.png"],
[UIImage imageNamed:@"3.png"],
nil];
}
我已經看到了一些錯誤信息如下
*** __NSAutoreleaseNoPool(): Object 0x926d620 of class NSPathStore2 autoreleased with no pool in place - just leaking
我給出通過修改下面的方法來解決這個問題。
@autoreleasepool
{
NSArray *animationArray = [NSArray arrayWithObjects:
[UIImage imageNamed:@"1.png"],
[UIImage imageNamed:@"2.png"],
[UIImage imageNamed:@"3.png"],
nil];
}
任何人都可以請向我解釋,在這種情況下發生了什麼。
我在ipad 4.3模擬器中發現了這個問題。在5.0和5.1中沒有問題。 – 2012-07-24 04:18:30
有趣。讓我們來看看IOS中添加了什麼來消除警告。 – Vignesh 2012-07-24 04:47:00