EXC_BAD_ACCESS in UIWebView
It's almost 100% an error in your code. Errors in the iPhone SDK are quite rare and UIWebView
has been tested quite good by many other developers.
EXC_BAD_ACCESS
occurs usually when you try to access an already released object. Obviously if Apple's code is trying to do that you are the one who has released the object wrongly. Are you sure you don't have a -autorelease
or -release
too much?
The scenario goes something like this:
- User enters screen with
UIWebView
. TheUIViewController
setsself
as the delegate - Web page starts downloading
- User exits screen
3a.UIViewController
gets deallocated UIWebView
finishes loading and sends "I finished" message to its delegate...
You need to stop the UIWebView
from loading its page and sets its delegate to nil before you deallocate the delegate.