Re: How are views supposed to reload after being nillified by memory warnings?
Re: How are views supposed to reload after being nillified by memory warnings?
- Subject: Re: How are views supposed to reload after being nillified by memory warnings?
- From: David Duncan <email@hidden>
- Date: Mon, 05 Mar 2012 16:14:16 -0800
On Mar 5, 2012, at 3:40 PM, G S wrote:
> No. But if you've presented a modal view controller, your entire view hierarchy (self.view) has been ripped out of the window, and if a memory warning arrives, then self.view will be set to nil. What happens next depends on if you implemented -viewDidUnload properly or if your view references are strong or weak.
>
> If they are strong and you did not implement -viewDidUnload properly, then your view reference will be non-nil.
>
> Not according to the Apple doc. By the time viewDidUnload is called, the view reference has already been set to nil:
I think you are confusing what I mean by "view reference" at the end there. Consider this interface:
@interface ViewController : UIViewController
@property (nonatomic, /* strong or weak */) UIView *subview;
@end;
My statement above refers to what happens to self.subview, not to self.view (hence why I used self.view the first time, then view reference the second time).
--
David Duncan
_______________________________________________
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