track “message sent to deallocated instance” via instruments-Collection of common programming errors
I had the same problem. At first I have used the Raffaello Colasante’s solution and passed NO to scrollRectToVisible:animated:. But then I’ve noticed that this method processed on another thread. You should check, whether you call [uitableview scrollRectToVisible: CGRectMake(0,0,1,1) animated:YES] on Main Thread (All ui actions should be performed on main thread). I change my code so to call it on Main Thread.
From:
//method called not from main thread
...
[someObjectInstance setOptionalActions:optActions];
To:
//method called not from main thread
...
dispatch_async(dispatch_get_main_queue(), ^{
//now method called from main thread
[someObjectInstance setOptionalActions:optActions];
});
Note: (setOptionalActions:) call -> (scrollRectToVisible:animated:)
Now problem fixed.
P.S. Instead of use Grand Central Dispatch(GCD), you can use another approach:
@implementation SomeObjectClass
...
- (void) setOptionalActions:(NSArray *) actionsArray {
... // handling of array
[myTableView scrollRectToVisible:CGRectMake(0,0,1,1) animated:YES];
}
...
@end
//method called not from main thread, but will be performed on main thread
[someObjectInstance performSelectorOnMainThread:@selector(setOptionalActions:) withObject:optionalActions waitUntilDone:NO];