Iphone – Crash when adding a view. (Web view)

I encountered a crash (triggered by an exception) when adding a WebView. I haven’t figured out the reason yet. Yes, I have browsed the Internet because this is a very common problem, although Without success, I found an answer saying that I should implement DSYM to trace the stack correctly, because it doesn’t make sense to look at all these addresses (I agree), the thing is I don’t know how to do it. I found this: save dsym files. But I didn’t figure out how to integrate it into my project, except that it seemed dangerous. Yes, I also enabled NSZombie, but to no avail.

Anyway now Coming to my question. I have a button that triggers an event, and the event changes the string (URL) based on the button pressed. Then, this IBAction calls a delegate, and the delegate is converted to a view with a UIWebView that will use the URL edited by the IBAction Open. 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 crash 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 it is trying to convert, but there is no actual The view is to be added. Although this is a crazy guess. Exceptions are usually called by these things, but in this case, I can’t see what happened.

Thank you for your help, if the problem Too stupid, please forgive me.

Guess from my side:

Is there a view in your nib that should be UIWebView, but you change the class of the view to WebView?

You should check it in the interface builder first. If you change the class of the view element to an unavailable class, this exception will occur.

< p>I encountered a crash (triggered by an exception) when adding a WebView. I haven’t figured out the reason yet. Yes, I have browsed the web because this is a very common problem, although it was not successful, I found an answer, Say I should implement DSYM to trace the stack correctly, because it doesn’t make sense to look at all these addresses (I agree), the thing is I don’t know how to do this. I found this: save dsym files. But I didn’t figure out how Integrating it into my project, except that it looks dangerous. Yes, I also enabled NSZombie, but to no avail.

Now comes my problem anyway. I have a trigger The button of the event, the event changes the string (URL) according to the button pressed. Then, this IBAction calls the delegate, and the delegate is converted to a view with a UIWebView, which will be opened with the URL edited by the IBAction. So I have the following code: /p>

This is the Delegate method:

WebViewController *awebViewController = [[WebViewController alloc] 
initWithNibName:@"WebView" bundle:nil];< br />[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];
[viewCont roller release];
viewController = nil;

This is the exact crash 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 It tries to transform, but there is no actual view to add. Although this is a crazy guess. Exceptions are usually called by these things, but in this case, I can’t see what happened.

< p>Thank you for your help, if the question is too stupid, please forgive me.

Guess from my side:

Is there a view in your nib that should be UIWebView, but you change the class of the view to WebView?

You should check it in the interface builder first. If you change the class of the view element to an unavailable class, this exception will occur.

p>

Leave a Comment

Your email address will not be published.