didReceiveMemoryWarning
Sent to the view controller when the application receives a memory warning.
Discussion
The default implementation of this method checks to see if the view controller can safely release its view. This is possible if the view itself does not have a superview and can be reloaded either from a nib file or using a custom loadView
method.
If the view can be released, this method releases it and calls the viewDidUnload
method.
You can override this method (as needed) to release any additional memory used by your view controller. If you do, be sure to call the super
implementation at
some point to allow the view controller to release its view. In iOS 3.0 and later, if your view controller holds references to objects in the view hierarchy, you should release those references in theviewDidUnload
method
instead. In earlier versions of iOS, you should continue to release them from this method. See the discussion in the viewDidUnload
method for information about
how to safely release outlets and other objects.
Availability
- Available in iOS 2.0 and later.