Advertise here

Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upgrade it to work on iphone 4 , iphone 4s and iphone 5

chanduschandus Posts: 12New Users
I have developed an application in xcode 4 with a deployment target iOS4.3. and its working fine in iphone i want to update it and make it work on iphone 4 and iphone 5.what are the necessary changes to be made to make it work with them.also i have a lot of UI elements in my app.are there any changes to be made to them? please help!


  • mashercakesmashercakes Posts: 789Registered Users @ @ @
    UI elements have remained consistent across iOS versions apart from some cosmetic changes (e.g. the rounded UISwitch which was introduced in iOS 5).

    To get the best visual appearance on retina displays, you should add double resolution versions of all images you are using in your app.

    To support the iPhone 5's taller screen, you need to add an iPhone 5 resolution launch image to prevent letterboxing, and then adjust your views to fit the iPhone 5 screen. This means either coding your UIs with logic to detect the screen size and adjust themselves accordingly, use auto layout type features, or building separate xibs for each device type.

    As for supporting the newer iOS versions, you'll have to just test all the features of your app on each iOS version and fix anything which doesn't work on the newer versions.
    <a href=""; target="_blank">TalkBoard</a> - a communication aid and visual support app for children and adults with autism, communication difficulties or learning difficulties. Available now for iPad, iPhone and iPod Touch.
  • Duncan CDuncan C Posts: 9,116Tutorial Authors, Registered Users @ @ @ @ @ @ @
    Masher gave a pretty good starting description of what to do. There were some subtle changes to the way things work between iOS 4 and 5 and between 5 and 6 that broke certain things. For example, if I remember correctly, the way the "parentViewController" property is used changed in 5.0 It used to be if you displayed a modal, the modal's parentViewController property would point to the view controller that displayed it. In 5.0, parentViewController is used for the new parent/child view controller scheme.

    Another change, added in 6.0 that can trip you up: Starting in 6.0, the shouldAutoRotateToUserInterfaceOrientation method isn't called any more. Instead, there is a new method supportedInterfaceOrientations. To make your code work correctly on both 6.0 and earlier versions, you need to implement both methods.

    There was a thread a while back where we discussed a way of putting your rotation logic in supportedInterfaceOrientations and then rewriting shouldAutoRotateToUserInterfaceOrientation to call supportedInterfaceOrientations.

    Here is the link:

    Supporting rotation in iOS 6 and earlier versions with the same code

    Your shouldAutoRotateToUserInterfaceOrientation method should look like this:
    -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        //vc can rotate, return YES for the supported ones
        if ([self shouldAutorotate]) {
            return ([self supportedInterfaceOrientations] & (1 << interfaceOrientation));
        //vc can't rotate, return YES only for the current orientation
        else {
            return interfaceOrientation == self.interfaceOrientation;

    (That code assumes that you've written shouldAutorotate and supportedInterfaceOrientations methods for 6.0. The shouldAutorotateToInterfaceOrientation method calls the new 6.0 methods and uses the results to return the correct response for OS versions before 6.0)
    Duncan C

    Animated GIF created with Face Dancer, available for free in the app store.

    I'm available for one-on-one help at CodeMentor
Sign In or Register to comment.