Re: So... we can't use UIWebView (with a delegate) on a page that's pushed onto a UINavigationController stack?
Re: So... we can't use UIWebView (with a delegate) on a page that's pushed onto a UINavigationController stack?
- Subject: Re: So... we can't use UIWebView (with a delegate) on a page that's pushed onto a UINavigationController stack?
- From: Jeff Kelley <email@hidden>
- Date: Mon, 20 Jun 2011 11:21:17 -0400
If you’re creating the web view in -viewDidLoad, you should probably release
it and nil the pointer to it in -viewDidUnload, not -dealloc.
Jeff Kelley
On Sat, Jun 18, 2011 at 12:19 PM, Matt Neuburg <email@hidden> wrote:
> >"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.
>
> What I do is start with a UIViewController subclass that creates the
> UIWebView in viewDidLoad and disposes of it in dealloc, setting the delegate
> to nil first, just as suggested in the docs. It's not clear to me why
> creating the UIWebView in the nib would make any difference. m.
>
> --
> matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
> A fool + a tool + an autorelease pool = cool!
> Programming iOS 4!
>
> http://www.apeth.net/matt/default.html#iosbook_______________________________________________
>
> 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
>
_______________________________________________
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