2

I inadvertently ended up with these values being used in an XCode build:

IPHONEOS_DEPLOYMENT_TARGET = 4.0
SDKROOT = iphonesimulator6.0

I never thought about his before (I'm an iOS noob) but would this mean my app would run on devices with iOS4 and above, or only on iOS6?

Mr. Boy
  • 60,845
  • 93
  • 320
  • 589

1 Answers1

2

Deployment target is the minimum version you support. SDK Root (or Base SDK in the GUI), is the set of frameworks you use when building. You must be aware tho, that building with SDK 6.0 gives access to many API calls that are not available in 4.0~5.0 etc, you MUST check their availability when using them or you will crash on older Software. You usually check availability of classes using NSClassFromString(@"NewClass"), if it returns nil its not available. To check available of new methods on existing classes, you use [OldClass respondsToSelector:@selector(newMethod:)] If you want to use new Frameworks linked in your project, you must declare them as Weak, or you'll crash on launch on older software

Rafael Nobre
  • 5,062
  • 40
  • 40
  • Wouldn't you get a warning if you're using 6.0 features but set your deployment target to 4.0? – DrummerB Sep 24 '12 at 14:27
  • 1
    Unfortunately XCode does not have that feature yet as far as I know. HOwever this answer seems to have a work-around to have warnings: http://stackoverflow.com/questions/4676000/is-there-a-way-for-xcode-to-warn-about-new-api-calls – Rafael Nobre Sep 24 '12 at 14:31