So... we can't use UIWebView (with a delegate) on a page that's pushed onto a UINavigationController stack?
So... we can't use UIWebView (with a delegate) on a page that's pushed onto a UINavigationController stack?
- Subject: So... we can't use UIWebView (with a delegate) on a page that's pushed onto a UINavigationController stack?
- From: G S <email@hidden>
- Date: Thu, 16 Jun 2011 19:15:25 -0700
My app is crashing after the user presses the Back button in the
navbar to dismiss a page that has a UIWebView on it, before the Web
view has finished loading. The Web view subsequently tries call its
delegate to say that the content has finished loading. In the Apple
docs I see this:
"Important: Before releasing an instance of UIWebView for which you
have set a delegate, you must first set the UIWebView delegate
property to nil before disposing of the UIWebView instance. This can
be done, for example, in the dealloc method where you dispose of the
UIWebView."
The delegate for the UIWebView is set up in the XIB file; it's pretty
hokey to have to intervene in code to then disassociate the view from
its delegate. Also, there is no "dealloc method where you dispose of
the UIWebView", because that's done automatically when the view is
popped off the navigation stack.
Does anyone know if I'm interpreting this situation correctly? I
guess the workaround is to set the UIWebView's delegate property to
nil in the UIWebView owner's "viewWillDisappear" method or something.
Thanks for any insight.
Gavin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden