Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There's no reason they would reject this. By deprecating the method, <code>-[UIView viewDidUnload]</code> simply becomes like any other method. You can treat it as if it never existed on <code>UIView</code> in the first place and you just happened to create a method called <code>-viewDidUnload</code>.</p> <p>It <em>would</em> be a problem if <code>-viewDidUnload</code> still existed internally (which it might) and you attempted to call Apple's (now private) implementation instead of your own but I highly doubt Apple would do this. Just remember in your <code>-viewDidUnload</code> to remember to ask if the super class implements the method before attempting to call it on super if that's what you're currently doing, using:</p> <pre><code>if ([[self superclass] instancesRespondToSelector:@selector(viewDidUnload)]) { [super viewDidUnload]; } </code></pre> <p>If you really wanted to be safe you could always move your code to a different method. Inside <code>viewDidUnload</code> just call your new method for iOS 5 devices and in <code>-didReceiveMemoryWarning</code> call your new method if you're on iOS 6.</p> <p>I'm not going to comment in length on the logic in your didReceiveMemoryWarning since that wasn't in the question but I will say that you should be very careful about the state you're putting the controller in (make sure those if statements cover all of your bases!) And of course, you cannot expect your view controller and its views to be in the same state when viewDidUnload is called by you as when it was called by UIKit in iOS 5.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload