views:

251

answers:

2
+2  Q: 

Iphone SDK 4 ???

I installed sdk 4 on my mac. I need to submit a version which runs on OS 3, and OS 4? What are my choices? can i install sdk3 again, and submit my app.

If i build with SDK4 is it going to run on devices with OS 3? I don't use any feature from OS 4

A: 

While you can set the Base SDK in the target build properties, the latest Xcode only comes with 3.2 annd 4.0 and the former is iPad only. Instead, you need to download an older version of Xcode (3.2.2) to develop for 3.x on the iPhone. You can install different sets of Xcode into different folders other than /Developer. The trick is finding an older version of Xcode. I save my copy (and I highly recommend you always keep 1 or 2 versions around), but they're not easily linked from the main devloper site. You can go to http://connect.apple.com and find them under Downloads -> Developer Tools.

It's kind of convoluted. There really ought to be a way to install a base SDK into the latest Xcode release. When Xcode 4 comes out, are we going to have to use the old interface to develop backwards compatible apps?

Details for developing for older firmware have also been covered in a previous thread.

Joost Schuur
It's actually not that complicated: set your Base SDK to 4.0, set your Deployment Target to 3.1.3, and as long as your app doesn't call any 3.2 or 4.0 only API's you build and run on 3.1.3 or 3.2 or 4.0 devices. Details [here](http://stackoverflow.com/questions/3088624/support-legacy-iphone-users/3122653#3122653)
progrmr
thanks, perfect answer . The problem was i was setting the base sdk to 3.0 instead of the target deployment
aryaxt
you should green check this answer if it solved your problem.
Clay Bridges
A: 

In PROJECT settings, set your BASE SDK to 4.0

In TARGET settings set your DEPLOY TARGET SDK to 3.0 (or 2.x or whatever you like.)

NOTE: If you use APIs that are above your lowest DEPLOY target (i.e., you use 4.0 APIs and you deploy to 3.x), you have to check for availability of that API. One way to do that is:

// Code written in browser, not tested.
- (BOOL) classIsAvailablie: (NSString*) className
{
    Class *theClass = NSClassFromString(className);
    return (theClass != nil);
}

// ...

if ([self classIsAvailable: @"Some4.0OnlyClass"])
{
    // ...
}
Olie