• 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: Rick Mann <email@hidden>
  • Date: Sat, 27 Oct 2012 15:53:55 -0700

On Oct 27, 2012, at 9:50 , David Duncan <email@hidden> wrote:

> Nope, and outside of ARC retain/strong is the only safe way to reference views via properties. That said, while evaluating behaviors in UIViewControllers in iOS 6 it was determined that it was not very useful to actually release your views in -viewDidUnload (or generally do any of the view related work that is typically done in -viewDidUnload). As such as of iOS 6 it is no longer called, and the recommendation is to not bother implement it for iOS 5 onwards.

Oh, interesting. That's too bad. I was just helping a friend with a memory exhaustion-related issue on older iOS (pre-4), and the code she was working on did no work in -didReceiveMemoryWarning.

Thinking iOS would also unload views not visible, I checked all the -viewDidUnload methods, none of them freed views. But we verified that indeed, on that OS, -viewDidUnload was called in response to triggering a memory warning in the Simulator. It makes intuitive sense that the OS can know to unload views it knows aren't currently visible, and reload them when necessary (say, popping UINavigationController frames).

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.

--
Rick




 _______________________________________________
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

  • Follow-Ups:
    • Re: ARC refactor misses IBOutlets?
      • From: David Duncan <email@hidden>
    • Re: ARC refactor misses IBOutlets?
      • From: Quincey Morris <email@hidden>
    • Re: ARC refactor misses IBOutlets?
      • From: Rick Mann <email@hidden>
References: 
 >ARC refactor misses IBOutlets? (From: Rick Mann <email@hidden>)
 >Re: ARC refactor misses IBOutlets? (From: David Duncan <email@hidden>)

  • Prev by Date: Re: ARC refactor misses IBOutlets?
  • 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