0

I have an application in the App Store, targeted for iOS 5, that runs correctly in iOS 6, and even iOS 7, but now, I wanted to add a new feature (just one new view with a controller).

The problem comes here: If I do compile the code with Xcode 5, it looks awkward, top status bar disappears, and even some views stop working.

I know this App needs a rewrite from Zero for iOS 7, but in the meantime, is there any way to make it work like it did before?

Can I somehow download a previous SDK, and in such case, will I be able to update the app to the App Store?

Vicenç Gascó
  • 1,326
  • 2
  • 13
  • 21

2 Answers2

0

You need to copy the 6.1 SDK from an older version of Xcode into the Xcode.app you've got now, and then select the 6.1 SDK specifically in the build settings.

For the device this is /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk, and for the simulator it is /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk. The paths are the same.

Stefan Fisk
  • 1,563
  • 13
  • 19
  • May be there is exist other folder for SDK's or there is option in Xcode where to look for SDKs? Because there is one problem in this solution: 6.1 sdk will disappear after Xcode update. – Cy-4AH Nov 25 '13 at 09:37
  • where can I get it if it isn't in my machine @Stefan ? – Vicenç Gascó Nov 25 '13 at 09:42
  • As far as I know there is not. You might however be able to symlink them into place, and then just recreate the symlinks after updates. – Stefan Fisk Nov 25 '13 at 09:43
  • 2
    Xcode 4.6 is available for download from https://developer.apple.com/downloads/index.action. – Stefan Fisk Nov 25 '13 at 09:46
  • Why was the answer downvoted? It works perfectly, I have shipped several releases using this method. – Stefan Fisk Nov 25 '13 at 09:46
  • Using pre iOS7 SDK's will not be supported soon because all the supported devices are iOS7 capable... you shouldn't ignore it, and supporting iOS7 at a basic level is not really a big deal – Laszlo Nov 25 '13 at 09:58
  • @TussLászló App compiled for IOS 6 doesn't mean that it will not run at IOS 7. – Cy-4AH Nov 25 '13 at 10:23
  • But not supporting the iOS7 base appearance could make your app declined sooner or later (like iPhone 5 support). You should always use the latest available SDK. – Laszlo Nov 25 '13 at 11:01
  • yes, but it not being supported in the future is different from this being a working solution for a current problem. He upgraded to Xcode 5, and now his app is broken, this solves the brokenness. – Stefan Fisk Nov 25 '13 at 11:49
0

Just download Xcode 4.6 from the developer page and use it parallel with Xcode 5.

But you don't really need to rewrite anything... Just make a subclass for UIViewController with a following code and use that instead the default.

- (void) viewDidLoad{
#if __IPHONE_7_0
    if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]) {
       [self  setEdgesForExtendedLayout:UIRectEdgeNone];
    }
#endif
}

Also don't forget that all UINavigationController is translucent in 7 and up and not translucent below.

Laszlo
  • 2,803
  • 2
  • 28
  • 33
  • 1
    This works when using (mostly) standard appearance for UI elements. If you added custom appearance for stuff like bar buttons, the app might very well look plain horrible when build with and running on iOS 7. – Stefan Fisk Nov 25 '13 at 11:48
  • not to mention how Xcode messes up xibs and storyboards when trying to use multiple version of Xcode on the same project. jeeezus the number of times I've had to manually edit the files to set the editor version. – Stefan Fisk Nov 25 '13 at 11:58
  • 2
    I use xibs "Opens in" `Xcode 4.6` with "Builds for" `iOS 4.3 and Later` and `Autolayout` turned off. And i used plain elements for all supported versions and no "horrible" visuals appeared. For the editor version issue, we have a solution: http://stackoverflow.com/questions/17718715/how-to-disable-xcode-5-automatically-upgrade-xibs-to-ios7-appearance – Laszlo Nov 25 '13 at 12:20
  • yep, for plain elements everything works wonderfully well, when fancy appearance stuff has been done it's impossibly to know what it might look like. – Stefan Fisk Nov 25 '13 at 13:16