Javascript Crashing UIWebview

Several sites break our application. This is similar to JavaScript. Any ideas on what I can do with this would be most appreciated.

2012-02-14 14:17:06.356 AppName[18347:17f03] CRASH: -[__NSCFDictionary setObject:forKey:]: attempt to insert nil key

2012-02-14 14:17:06.358 AppName[18347:17f03] Stack Trace: (
0   CoreFoundation                      0x02c3806e __exceptionPreprocess + 206
1   libobjc.A.dylib                     0x02dc9d0a objc_exception_throw + 44
2   CoreFoundation                      0x02be0a78 +[NSException raise:format:arguments:] + 136
3   CoreFoundation                      0x02be09e9 +[NSException raise:format:] + 57
4   CoreFoundation                      0x02c372b9 -[__NSCFDictionary setObject:forKey:] + 169
5   WebKit                              0x03f67d2d -[WebHistoryPrivate visitedURL:withTitle:increaseVisitCount:] + 285
6   WebKit                              0x03f688c3 -[WebHistory(WebInternal) _visitedURL:withTitle:method:wasFailure:increaseVisitCount:] + 67
7   WebKit                              0x03f5cf3f _ZN20WebFrameLoaderClient19updateGlobalHistoryEv + 921
8   WebCore                             0x043d2c64 _ZN7WebCore17HistoryController12replaceStateEN3WTF10PassRefPtrINS_21SerializedScriptValueEEERKNS1_6StringES7_ + 308
9   WebCore                             0x043d27e9 _ZN7WebCore7History16stateObjectAddedEN3WTF10PassRefPtrINS_21SerializedScriptValueEEERKNS1_6StringES7_NS0_15StateObjectTypeERi + 167
10  WebCore                             0x0462bc2d _ZN7WebCore9JSHistory12replaceStateEPN3JSC9ExecStateE + 439
11  WebCore                             0x0462b191 _ZN7WebCore38jsHistoryPrototypeFunctionReplaceStateEPN3JSC9ExecStateE + 113
12  JavaScriptCore                      0x06dc2cfc _ZN3JSC11Interpreter14privateExecuteENS0_13ExecutionFlagEPNS_12RegisterFileEPNS_9ExecStateE + 57978
)
Program ended with exit code: 0

Message was edited by earthquakeCountry on 2/13/12 at 9:23 PM
+5
source share
2 answers

For others with this problem, if you are not intentionally loading blank pages anywhere, you can try adding this to your webView: shouldStartLoadWithRequest:

if (request == nil) {
    return NO;
}
0
source

check where you add data to NSDictionary. it might be that place to insert a null value.

what creates the problem

-1
source

All Articles