Error while running in Xcode 6 an app created in Xcode 5

1

I have an app that runs perfectly on Xcode 5. For the purpose of updating, I installed Xcode 6 and went to run the same app (without uninstalling Xcode 5). From there, 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. Already 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 master view hidden, if I tap the screen and drag the master view appears and the app runs incorrectly. In this case, I believe the problem might be caused by the shouldHideViewController method that was dropped on iOS8. However, the target in my app is 7.0.

It may be very specific questions, but somebody may know these problems.

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

    
asked by anonymous 04.11.2014 / 00:27

1 answer

2

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

With xCode 6 , you'll start building 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 If SDK8 adds functionality to iOS8 yet you can seamlessly iOS 7 into SDK8 .

That said, you are required to support iOS8 in your application (and use the new xCode6 / SDK8), which will probably cause a lot of headaches (I speak from my experience) to support the new and old functionality. In the greater cases you will 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
   }

On the issues you mentioned, when the device changes its orientation, before iOS8, you get the size of the pre-orientation orientation, with iOS8 you get the orientation to which it will go change after rotation . I use this in my application.

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

    
04.11.2014 / 19:23