【发布时间】:2012-07-24 04:06:25
【问题描述】:
我的应用程序是启用 ARC 的。
在应用程序委托中我写了一个代码
[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];
}
谁能给我解释一下,在这种情况下发生了什么。
【问题讨论】:
标签: iphone ios automatic-ref-counting nsautoreleasepool