I am calling a method that goes in a background thread:
[self performSelectorInBackground:@selector(loadViewControllerWithIndex:) withObject:[NSNumber number
I agree that most likely the reason for this is because the leaked object (an NSNumber), is a parameter passed in from outside the thread. Hence, this variable belongs to the calling thread (and its autorelease pool)
The calling thread should use NSAutoreleasePool
and I suggest that you add a retain instruction to your parameter as:
- (void) loadViewControllerWithIndex:(NSNumber *)indexNumberObj {
NSAutoreleasePool *arPool = [[NSAutoreleasePool alloc] init];
[indexNumberObj retain];
....
[arPool release];
}