2012-02-14 89 views
5

少数网站崩溃我们的应用程序。它似乎与JavaScript有关。关于我能做些什么的任何想法都将非常感激。JavaScript崩溃UIWebview

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 
+1

[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@“about:blank”]]];在每个页面加载到应用程序之前,他们希望显示一个空白屏幕以向用户显示应用程序是否响应。因此插入了一个空白页面。一旦我删除它,它修复了前述的崩溃。 – user1208489 2012-02-14 14:33:35

回答

-1

检查您在NSDictionary中添加数据的位置。可能是那个地方插入了空值。

,创造一个问题

0

对于其他人有这个问题,如果你无处有意加载空白页,你可以尝试添加这网页视图:shouldStartLoadWithRequest:

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