10.10.2012

How iOS 6 Messed Up Pre-iOS 6 Applications

Probably one of the most annoying things for iOS users when iOS 6 came out is that their downloaded apps are not working with the new iOS version. Most of the apps in the AppStore (or any other download sites) were written to run in an optimal level with iOS 5, and maybe also with iOS 4. Software developers are not clairvoyant you know (... well maybe some but not all). So, if the app they created for iOS 5 is no longer functional in iOS 6, it is not completely--they are still liable for some errors because of their carelessness, of course--their fault. They won't know the changes to the SDK until, well, it's too late... (I just had my app publiiiiiiiiiiiiiiiiiiieeeeeeeshedaaaaargggh!!! - one random unhappy iOS developer)

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
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
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 presentedViewControllerpresentViewController: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)

presentViewController:animated:completion:
Presents a view controller.

dismissViewControllerAnimated:completion:
Dismisses the view controller that was presented by the receiver.



1 comment:

  1. Info strikes deeply in the mind.Thanks for sharing the blog. Finally iPhone 5 has launched with new iOS 6 operating system. Now iPhone developers must seek to enhance their development skill set generating iOS 6 apps that are simple yet appealing with powerful iPhone 5 App Development.

    ReplyDelete