0
當我加載UIWebView
上的html時,ios8
應用程序崩潰。 當我再次它不會崩潰打開網頁第二次,它發生只在IOS 8ios 8上的UIWebView崩潰
在ViewWillAppear
調用OpenLink在
-(void)openLink{
NSString *pathFile = [[NSBundle mainBundle] pathForResource:filePath ofType:@"html"];
NSURL *url = [NSURL fileURLWithPath:pathFile ];
NSString *urlwithoutQueryString = [url absoluteString];
NSString * urlWithQueryString = [NSString stringWithFormat:@"%@?%@",urlwithoutQueryString, filePathAnchor];
NSURL *url2 = [NSURL URLWithString:urlWithQueryString];
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:url2];
if ([webView request] != urlRequest){
[webView loadRequest:urlRequest];
}
NSString *str =[NSString stringWithFormat:@"javascript:gotoInternalHref('0000');"];
[webView stringByEvaluatingJavaScriptFromString:str];
}
JavaScript函數
function gotoInternalHref(posIndex) {
LocationHash = "#" + posIndex;
positionindex = posIndex;
window.location.hash = LocationHash;
}
請幫助我解決這個問題。
在此先感謝。
嘗試使用NSZombies啓用調試 – muffe 2015-02-10 13:14:10
@ muffe2k它啓用.. – 2015-02-11 06:55:05