1
我正在從頭開始構建Web瀏覽器,除了最重要的事情之外,大多數所有工作都可以工作。瀏覽器將失敗,出現sigabrt錯誤,而我剛接觸iPhone編程時,我確信這意味着我沒有正確發送URL。iPhone模擬器繼續無法加載網頁的錯誤sigabrt
這是通過按下按鈕加載網頁的代碼。
- (IBAction)getURLButton:(NSString *)aString {
NSURL *URL = [NSURL URLWithString:aString];
NSURLRequest *URLRequest = [NSURLRequest requestWithURL:URL];
BOOL load = [addressBar webView: (goButton) shouldStartLoadWithRequest:URLRequest navigationType:UIWebViewNavigationTypeFormSubmitted];
if (load) {
error = nil;
[goButton loadRequest:URLRequest];
//currentURLString = [UIWebView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
//It's not in Xcode? It continues to get an error after I write the above statement.
} else {
NSString *message = NSURLErrorFailingURLErrorKey;
NSLog(@"%@",message);
}
}
這是錯誤消息:
2013-02-14 16:49:28.724 WebBrowser[1265:c07] -[ViewController getURL:]: unrecognized selector sent to instance 0x716f1d0
2013-02-14 16:49:28.727 WebBrowser[1265:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ViewController getURL:]: unrecognized selector sent to instance 0x716f1d0'
我所知道的錯誤有沒有什麼地方,我只是不知道在哪裏。幫幫我?
請參閱我的回答我已更新它。 – SAPLogix 2013-02-23 07:11:08