• 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: ARC refactor misses IBOutlets?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ARC refactor misses IBOutlets?


  • Subject: Re: ARC refactor misses IBOutlets?
  • From: Quincey Morris <email@hidden>
  • Date: Sat, 27 Oct 2012 16:29:02 -0700

On Oct 27, 2012, at 15:53 , Rick Mann <email@hidden> wrote:

In this way, -viewDidLoad and -viewDidUnload are nicely symmetrical (although I've experienced other asymmetries between them).

So, in iOS 6, -viewDidUnload is no longer called, so any work one might've done there is never being done (say, removing observers or invalidating timers). I'm disappointed there's no way for the compiler to warn me. I sure don't recall reading about this change, but it seems quite severe.

One of the problems with the old way is they're *not* symmetric as typically used. "Load" in these method names refers to the loading of resource (i.e. the nib containing the view). 'viewDidLoad' often gets used as "the place to put things when the view is initially created" -- because the view is initially created just after the nib is loaded.

'viewDidUnload' means the time when the nib is removed from memory, and has nothing directly to do with the lifetime of the view. So if you need to tear down observers etc, a different method is better -- either viewDidDisappear or dealloc, for example. David's point is that examination of code patterns showed that there really isn't anything that properly belongs in 'viewDidUnload' that can't be moved elsewhere, and many apps were incorrectly putting code in 'viewDidUnload' that should have been elsewhere. (In the latter case, the problem might never show up, because it would only matter in a severely contained memory environment.)


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >ARC refactor misses IBOutlets? (From: Rick Mann <email@hidden>)
 >Re: ARC refactor misses IBOutlets? (From: David Duncan <email@hidden>)
 >Re: ARC refactor misses IBOutlets? (From: Rick Mann <email@hidden>)

  • Prev by Date: Instruments source line colors?
  • Next by Date: Re: ARC refactor misses IBOutlets?
  • Previous by thread: Re: ARC refactor misses IBOutlets?
  • Next by thread: Re: ARC refactor misses IBOutlets?
  • Index(es):
    • Date
    • Thread