Error running Xcode 6 an app created in Xcode 5

Asked

Viewed 94 times

1

I have an app that runs perfectly on Xcode 5. For update effect, I installed Xcode 6 and ran the same app (without uninstalling Xcode 5). Then I found some problems, among them:

1) The app runs only in Landscape orientation. In Xcode 5 to take the width of the screen I use self.view.frame.size.height. In Xcode 6 I have to use self.view.frame.size.width.

2) The app uses Uisplitviewcontroller and there is a button that shows or hides the master view. However, in Xcode 6 with the hidden master view, if I touch the screen and drag the master view appears and the app runs incorrectly. In this case, I believe the problem may be caused by the method shouldHideViewController which was deprecated in iOS8. However, the target in my app is 7.0.

Maybe they are very specific doubts, but someone can know these problems.

Last doubt, an app created in Xcode 5 can run on iOS8?

1 answer

2


Some details to help you better understand the process of Xcode/SDK/IOS.

With the Xcode 6, you started creating applications with SDK8.

However, SDK and minimum target of the application are distinct things, that is, the SDK is a set of frameworks/Api where your code will run, and in case SDK8 adds functionality to the iOS8, yet you can perfectly iOS 7 in the SDK8.

That being said, you are required to support iOS8 in your application (and use the new xCode6/SDK8), which will likely cause a lot of headaches (speaking from my experience) to support new and old functionality. In the biggest case you’ll have to add something like:

  NSOperatingSystemVersion ios8_0_1 = (NSOperatingSystemVersion){8, 0, 1};
   if ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:ios8_0_1]) {
      // iOS 8.0.1 and above logic
   } else {
      // iOS 8.0.0 and below logic
   }

About the problems you mentioned, the moment the device changes orientation, before iOS8, you get the orientation size preorientation, with iOS8 you will receive the guidance to which this will change after rotation. I use this in an app of mine.

if ([[[UIDevice currentDevice] systemVersion] floatValue] < 8.0) {
    //implicitly in Portrait orientation.
    if(orientation == UIInterfaceOrientationLandscapeRight || orientation == UIInterfaceOrientationLandscapeLeft){
        CGRect temp = CGRectZero;
        temp.size.width = fullScreenRect.size.height;
        temp.size.height = fullScreenRect.size.width;
        fullScreenRect = temp;
    }
}

I hope it helps you

  • It will help a lot. Perfect! Thank you so much for your time.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.