Anyway, so why are some apps not working or why are they crashing a lot? The answer, my friends, are the deprecated methods/functions (whatever you call them). Here are some of the common problems and the possible solutions to them:
Problem 1:
My app crashes every 5 minutes!
Causes:
viewDidUnload
Called when the controller’s view is released from memory. (Deprecated in iOS 6.0. Views are no longer purged under low-memory conditions and so this method is never called.)
viewWillUnload
Called just before releasing the controller’s view from memory. (Deprecated in iOS 6.0. Views are no longer purged under low-memory conditions and so this method is never called.)
Solution:
Use applicationDidReceiveMemoryWarning: to handle low-memory conditions.
applicationDidReceiveMemoryWarning:
Tells the delegate when the application receives a memory warning from the system.
Problem 2:
My app is not changing its orientation when I rotate the device!
Cause:
shouldAutorotateToInterfaceOrientation:
Returns a Boolean value indicating whether the view controller supports the specified orientation. (Deprecated in iOS 6.0. Override the supportedInterfaceOrientations and preferredInterfaceOrientationForPresentation methods instead.)
Solutions:
Use shouldAutorotate, supportedInterfaceOrientations, preferredInterfaceOrientationForPresentation.
shouldAutorotate
Returns whether the view controller’s contents should auto rotate.
supportedInterfaceOrientations
supportedInterfaceOrientations
Returns all of the interface orientations that the view controller supports.
preferredInterfaceOrientationForPresentation
Returns the interface orientation to use when presenting the view controller.
Problem 3:
My app launched but is not showing anything!
Causes:
modalViewController
modalViewController
The controller for the active presented view—that is, the view that is temporarily displayed on top of the view managed by the receiver. (read-only) (Deprecated in iOS 6.0. Use presentedViewController instead.)
presentModalViewController:animated:
Presents a modal view managed by the given view controller to the user. (Deprecated in iOS 6.0. Use presentViewController:animated:completion: instead.)
dismissModalViewControllerAnimated:
Dismisses the view controller that was presented by the receiver. (Deprecated in iOS 6.0. Use dismissViewControllerAnimated:completion: instead.)
Solutions:
Use presentedViewController, presentViewController:animated:completion:, and dismissViewControllerAnimated:completion:.
presentedViewController
presentViewController:animated:completion:
Solutions:
Use presentedViewController, presentViewController:animated:completion:, and dismissViewControllerAnimated:completion:.
presentedViewController
The view controller that is presented by this view controller, or one of its ancestors in the view controller hierarchy. (read-only)
Presents a view controller.
dismissViewControllerAnimated:completion:
Dismisses the view controller that was presented by the receiver.