2013-03-15 3 views
1

UIWebView에 문제가 있습니다. iframe이 어떤 내용을로드하고, 어떤 이유로 나는 소스를 변경하거나 내가 요소를 제거하면, 나는 다음과 같은 예외를 얻을 :ios iframe에서 웹보기 관련 문제가 발생했습니다.

MyApp[5812:11303] shouldStartLoadWithRequest 
2013-03-14 18:48:45.899 MyApp[5812:11303] shouldStartLoadWithRequest 
2013-03-14 18:48:45.900 MyApp[5812:11303] *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSInvalidArgumentException> *** setObjectForKey: key cannot be nil 
2013-03-14 18:48:45.901 MyApp[5812:13603] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: key cannot be nil' 
*** First throw call stack: 
(0x1c94012 0x10d1e7e 0x1d170de 0x26e35ce 0x26e5693 0x26d44b5 0x2bf8747 0x2bf5610 0x2ec841a 0x2ec6c49 0xb0108ef 0x6619e11 0x6572fc3 0x2dd9d34 0x2eacd15 0x2b31eac 0x2b31c76 0x317bce9 0x2b176d5 0x2b184a5 0x316ade9 0x2b1772e 0x317cc6d 0x2b1e3f4 0x2b1f97b 0x2b2382f 0x26f1f7b 0x356182c 0x3561795 0x3564b2f 0x35648bb 0x356bffb 0x356487c 0x1e50f4 0x356bffb 0x1e4deb 0x1e5787 0x356c548 0x1c17f3f 0x1c17a39 0x1c3a734 0x1c39f44 0x1c39e1b 0x356bc50 0x97efced9 0x97f006de) 
libc++abi.dylib: terminate called throwing an exception 
(lldb) 

내가이 시나리오를 내 코드에 거래를 추가해야 뭔가가 있나요 ? webWiew이

- (void)scrolToID 
{ 
    NSString *jsCall = [NSString stringWithFormat:@"window.location.hash='#%@'", currentID]; 
    [self.webView stringByEvaluatingJavaScriptFromString:jsCall]; 
} 

를로드하기 전에 내 경우

답변

0

은 내가 그것은 webViewDidFinishLoad

에 전화를해야 viewWillAppear에 내 방법 scrollToId를 호출했기 때문에
관련 문제