I use a UIWebView to connect my app to the gmail web view… if I close the the viewController.. after a short time I get this error :
[MailViewController respondsToSelector:]: message sent to deallocated instance 0x142c8c00
I also try to use the method:
- (IBAction)close:(id)sender{
[web stopLoading];
[self dismissModalViewControllerAnimated:YES];
}
without any success… how can I fix my problem?
You probably forgot to set the
UIWebView‘sdelegatetonilin thedeallocmethod of yourMainViewController.Thus the webview send some message to its delegate (the
MainViewController) after it has been deallocated, explaining the crash.From the
-[UIWebView delegate]method documentation: