I just downloaded the crash reports for one of my iPhone apps from iTunes Connect. The most common crash has a trace like the following:
Exception Type: EX
I had a similar problem. I was using:
[webView loadHTMLString:str baseURL:tmpUrl];
[str release];
The release of "str" caused the error message "EXC_BAD_ACCESS"
Take a harder look inside the thing in your code that is implementing the UIWebViewDelegate
protocol. In particular you want to look at whatever is handling webViewDidFinishLoad:
You are trying to access a variable that's been released. Post the full source if you can, that will help us find it for you.
I recently had a similar problem where my apps were crashing randomly. Turns out the problem was in using "onclick=
" in the loaded HTML.
Replaced the onclick
with simple <a href="javascript:some_script">
and the problem went away.
Hope this helps others who are experiencing the same issue with webviews
.
The scenario goes something like this:
UIWebView
. The UIViewController
sets self
as the delegateUIViewController
gets deallocatedUIWebView
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.
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?