I have a UITableView inside a UITabBarController.
When I'm calling
[[self navigationController] pushViewController:myViewController animated:YES];
there is no problem.
But, when I'm calling the same line from inside a UIActionSheetDelegate, for example:
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
I get EXC_BAD_ACCESS.
It seems that calling this line from a different thread causing this issue.
How can I prevent this EXC_BAD_ACCESS issue?
(notice that myViewController is NOT nil, or something like that)
thanks!
EXC_BAD_ACCESS is thrown when you try to access a released object, and actionSheet:clickedButtonAtIndex: is called on the main thread, after the action sheet is dismissed, so I'm guessing what's pointed by myViewController is released.
It doesn't have to be nil, in fact, that's the problem. The object pointed is released, but the pointer is not nil.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With