Possible duplicate:How will my iPhone Objective-C code receive Javascript error notification in UIWebView?
I'm confused about the problem of developing javascript for UIWebViewin an iPhone application. If there is an error in javascript, it silently exits and stops the execution of the function being executed. And some errors do not occur in the desktop browser, so everything looks fine. Then I run it on the iPhone and get a massive crash because the function is halfway through and I don't know why. Then I slowly and methodically comment on various lines of code until catastrophic failures occur to pinpoint the line of code violation.
UIWebView
This sucks.
So, is there anyway a way to get UIWebViewto log or report JavaScript errors anyway? They obviously happen, I just donβt know why and how, and it complicates my life.
There is already a message for the same problem:
How will my iPhone Objective-C code receive Javascript error notification in UIWebView?
You can connect the UIWebView control to the hidden WebKit structure and get all exceptions, functions performed, etc.
Safari iOS, ? β Safari β Developer . UIWebView , , , iOS Safari. .
Do you implement the UIWebView didFailLoadWithError delegate?
It may give you an error code.