title: How should I tidy UIViewControllers when they need to be destroyed
body: <p>I'm starting to write the second version of our iPhone app and I'm trying to tidy up previous mistakes (as it's my first attempt at Objective-C). My question is related to "things I need to do when a UIViewController is destroyed", there seem to be a few contradictory answers out there and I want to make sure I understand correctly.</p>
  
  <p>Couple of constraints:</p>
  
  <ol>
  <li>This code is for use with iOS 5 and iOS 6 devices </li>
  <li>I don't wish to register and deregister NSNotifications on viewWillAppear and viewWillDisappear because the UIViewControllers need to receive notifications even if they can't be seen by the user.</li>
  <li>I'm using a StoryBoard rather than separate nib files.</li>
  </ol>
  
  <p>So considering the above constraints, are the following statements true?</p>
  
  <ol>
  <li>IBOutlets connecting the storyboard to the UIViewControllers should be weak, the strong reference will be created behind the scenes.</li>
  <li>Because the IBOutlets are weak I shouldn't need to nil them out in low memory situations</li>
  <li>I shouldn't use viewDidUnload because it's being deprecated instead I should use didReceiveMemoryWarning. In this situation I only need to nil out strong properties (that can re-calculated)</li>
  <li>It's acceptable to register for NSNotifications on viewDidLoad.</li>
  <li>Because I wish to continue receiving notifications when the view is hidden, the best place to unregister them is in dealloc, there's no benefit in also unregistering them in didReceiveMemoryWarning.</li>
  </ol>
  
  <p>Thanks for your help,</p>
  
  <p>Dan</p>