Reputation: 3790
I am pushing BViewController from A properly. B contains a webview that starts loading a page when viewDidLoad. I am getting a strange behavior when popping B to A,
I checked on both situations viewcontrollers that are on navigation stack. Both cases with same result, 2 same objects, no difference!
-(IBAction)goBackOrg:(id)sender{
NSArray *viewControllers = self.navigationController.viewControllers;
[[self navigationController] popViewControllerAnimated:NO];
}
and for previously pushing it, I am using
if(!self.BController){
self.BController = [[BViewController alloc] initWithNibName:@"BViewController" bundle:nil anUrlDest:urlSocial];
}
[[self navigationController] pushViewController:self.BController animated:NO];
Upvotes: 2
Views: 1673
Reputation: 31091
May be You are loading your webView on Thread
and when you are using thread then you cannot do changes in UI otherwise your app will crash.
So just do this task on mainThread .
Upvotes: 0
Reputation: 17014
EXC_BAD_ACCESS occurs when you're trying to access an object that has been deallocated.
So the following could be your problem: when you pop ViewController B, it is being unloaded. If the web view loading finishes after ViewController B is unloaded, some piece of callback code is getting executed that is trying to do something with your ViewController or its view (or similar).
Upvotes: 1