Reputation: 2561
My application is ARC enabled one.
In the app delegate i have written a code
[self performSelectorInBackground:@selector(initializeAnimationImageArrays) withObject:nil];
And my method is
- (void)initializeAnimationImageArrays
{
NSArray *animationArray = [NSArray arrayWithObjects:
[UIImage imageNamed:@"1.png"],
[UIImage imageNamed:@"2.png"],
[UIImage imageNamed:@"3.png"],
nil];
}
I have seen some error messages as given below
*** __NSAutoreleaseNoPool(): Object 0x926d620 of class NSPathStore2 autoreleased with no pool in place - just leaking
I fixed this issue by modifying the method as below.
@autoreleasepool
{
NSArray *animationArray = [NSArray arrayWithObjects:
[UIImage imageNamed:@"1.png"],
[UIImage imageNamed:@"2.png"],
[UIImage imageNamed:@"3.png"],
nil];
}
Can anyone please explain to me, what is happening in this context.
Upvotes: 1
Views: 843
Reputation: 10251
It says you do not have an autorelease pool to manage autoreleased objects. By default, main thread will have its autorelease pool. When you create a thread you have to create an autorelease pool on your own.
Upvotes: 3