• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How are views supposed to reload after being nillified by memory warnings?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How are views supposed to reload after being nillified by memory warnings?
      • From: G S <email@hidden>
References: 
 >Re: How are views supposed to reload after being nillified by memory warnings? (From: Matt Neuburg <email@hidden>)
 >Re: How are views supposed to reload after being nillified by memory warnings? (From: David Duncan <email@hidden>)
 >Re: How are views supposed to reload after being nillified by memory warnings? (From: G S <email@hidden>)

  • Prev by Date: Re: How are views supposed to reload after being nillified by memory warnings?
  • Next by Date: Re: Unclear on -initWithBytesNoCopy:
  • Previous by thread: Re: How are views supposed to reload after being nillified by memory warnings?
  • Next by thread: Re: How are views supposed to reload after being nillified by memory warnings?
  • Index(es):
    • Date
    • Thread