Crash (SIGABRT) when adding a view. (Webview)

I am having a crash (caused by an exception) when adding a WebView. I do not understand why. And yes, I browsed the Internet because it is a very common problem, although without success, I found the answer saying that I have to implement DSYM in order to track the stack correctly, because looking at all these addresses is simply pointless (and I agree), the fact is, I have no idea how to do this. I found this: save dsym files. But I did not understand how to integrate it into my project, moreover, it looks dangerous. And yes, I also support NSZombie, but to no avail.

Anyway, now to my question. I have a button that fires an event, the event changes the line (URL) according to the pressed button. This IBAction then calls the delegate, and the delegate jumps to the view with the UIWebView that opens with the URL edited by IBAction. So I have the following code:

This is the delegate method:

WebViewController *awebViewController = [[WebViewController alloc] 
                                         initWithNibName:@"WebView" bundle:nil];
[self setWebViewController:awebViewController];
[awebViewController release];
self.webViewController.finalURL = [NSMutableString stringWithFormat:@"%@", linkString];
[viewController.view removeFromSuperview];
// HERE happens the crash, found out using breakpoints
[self.window addSubview:[webViewController view]];

[UIView commitAnimations];
[viewController release];
viewController = nil;

This is the exact error message:

-[WebView initWithCoder:]: unrecognized selector sent to instance 0x5718320
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
reason: '[WebView initWithCoder:]: unrecognized selector sent to instance 0x5718320'

I have a theory that he is trying to make the transition, but there is no actual view to add. Although this is a wild hunch. Exceptions are usually called such things, but in this case I don’t see what happens.

Thank you for your help and goodbye if this is too stupid a question.

+3
source share
3 answers

Guess on my part:

nib, UIWebView, WebView?

.
- , , , .

+4

, - WebView (not UIWebView) 0x5718320 -initWithCoder:, . , Interface Builder; , WebView.

+2

, WebView WebViewCustom Xractor refractor/Rename, , .

+1

Source: https://habr.com/ru/post/1792807/


All Articles