If I install SDK 4.0 of the iPhone OS will I still be able to create a non 4.0 iPad app? - iphone

If I install SDK 4.0 of the iPhone OS will I still be able to create a non 4.0 iPad app?
I would ideally like to submit a iPad app in the next month but am also hoping to develop a 4.0 iPhone app is it possible to use the 4.0 SDK to create 3.0 iPad apps or am I going to need to computers?

You do not need two computers. You will have to install the two SDKs in two different directories. So far, it's always been the way that beta releases of the SDK were not meant (and not allowed) to generate apps for distribution.
But in the installer, just select another new directory and then install the second SDK there. That's all there is to it.

So far Apple has always provided a way to create Applications compatible to older versions of iPhone/iPad OS. The SDK installer will install the SDK in a version specific subdirectory. Additionally there is a "Current" directory hardlinking against the newest version. The old versions will still be available.
XCode will let you select an iPhone OS Version in the build settings and automatically figure out the correct SDK version/directory, so there's no need to fumble with paths or include directories.

Build against the latest SDK and set your "deployment target" to a lower version.
If you use new API calls (available in the SDK but not in the deployment version) check at runtime before calling them.

Related

when deploying an iOS app for an older SDK, how to test it?

I have written an app and its base SDK is set to 4.2, and at the moment it is in the app store with a deployment target set to 4.2, I'm sure you'll agree this is a bad idea because I am alienating all potential users who do not have the latest version of iOS installed.
So my question is, when deploying for an older version of iOS, how do I make sure it will run, i.e. how do I check whether I've used any modern API's that are not present in the deployment target iOS version?
The only sure-fire way to make sure your app will run is to test on a device running the older OS version you specify.
Even old versions of the iPhone Simulator (if you can find such) will not do a good job of checking for compatibility.
Most developers who want to support customers on iPhoneOS 3.x have access to an old test device, such as an used iPod Touch (hand-me-down, or purchased on eBay, etc.) running the OS version set in the app's Deployment Target. Otherwise, the developer is just guessing/gambling.
Check the documentation of the libraries or methods you are using. Test on the actually device installed with the version of the OS you wish to support.
Change the Base sdk version to 4.2, target sdk to 3.0 or any.
test the app in simulator as the target as simulator 3.0 r any.
But, when compared to 3.2 , 4.2 version has many new functionalities that do not work on 3.2 version devices.
So take respective steps to do for 3.2 r for 4.2.
The better idea is to find the version of the device , then give the accessibility based on the version.
Thanks,
Bharath

Which iPhone SDK to use for compatibility

i'm writing my first iPhone app with aim to upload it to the AppStore and don't understand one thing:
Most popular games on the AppStore have compatibility with iPhone OS 3.0 or later. I have currently installed iPhone SDK 4.0 i believe.
I want my app to have the same compatibility starting from 3.0, do i have to install and use in development an earlier SDK, like 3.0 to achieve that goal or i can somehow use the latest SDK?
Thanks for any help!
You should always build against the most current SDK, that is 4.1 at the moment. You can set your minimum requirement differently though, i.e. 3.0.
To be able to upload your application to appstore you must build it using SDK 4.0 at least.
Then in build target settings you can specify minimum OS version your application can be run on - check "iPhone OS Deployment Target" setting.
Remember that if you use some APIs that are available not on all OS versions you support you should do run-time checks for them to avoid application crashes.

Can a user install iphone application developed using 3.1.3 in his iphone 3.0?

Can a user install my application from iTunesStore if he is having iPhone OS 3.0 or having lower version of iPhone OS and I have developed my application using iPhone SDK 3.1.3...
Can anyone help me with this...
Thanx in advance...
In you projects settings, use a build setting named "iPhone OS Deployment Target" to specify your minimal iPhone OS version.
To do that, double click the blue project icon (at the top of the project’s "Groups and Files" table), click the "Build" tab and find the setting in the "Deployment" settings section.
To use features from a later iPhone OS, see this question.
If you compile your application to target iPhone OS 3.1.3 then it will not run on 3.0 - instead the user will get a message telling them to update their OS when they try to install.
However, there's a good chance that you will be able to compile your app to target 3.0 as long as you're not using any specific 3.1+ and newer features. To do so, just change the Active SDK you target in Xcode before you compile. Then your app will run on both 3.0 and 3.1.3
If you set your Target SDk in Xcode to 3.1.3, you may be using features of the SDK not found on an iPhone running a lower OS. However, you can test for those features in your program and take alternative measures if the user does not have those features/frameworks available. There is nothing that will prevent your app from running on older iPhone OSes, other than the fact that using new features will cause the app to fail.
On the other hand, you use the Deployment SDk value of XCode to limit which iPhone OSes can actually run your app. This way you can limit the app to be available to only iPhones with later OS and not the earlier ones. The Apple iTunes App Store will use the Deployment SDk value to tell the user who is purchasing, what the minimum system requirement is too.

Choosing iPhone SDK in latest Xcode: Only 3.0 SDKs are available, but I have 2.0 on disk

After I downloaded the latest Xcode with the 3.1.2 SDK, I can't build and test for 2.2.1 anymore. I have the 2.2.1 SDK in the proper directory of my Developer folder.
Is there a setting I have to change?
Yes, to choose an older SDK in the Active SDK popup you have to set either the Base SDK or the Deployment Target build setting of your target to a value equal to or less than 2.2.1.
The Base SDK expresses your intention of what API your code is written for.
The Deployment Target expresses your intention of the earliest iPhone OS you want your app to run on.
The Active SDK is your build-time choice of SDK to use, usually Device vs. Simulator. But you will fail if you try to build against an SDK that is older than what your code is written for. If you code is indeed written to compile against older SDKs and/or run on older OS versions, you must express this by setting the appropriate build settings in the Target. Otherwise the Active SDK popup will limit you to what it knows will work with your code.
Where are you trying to select it? As the base SDK?
You should always be linking against the newest SDK version (this is what an Apple engineer told me directly at an iphone dev event) and then set your Deployment Target back as far as you want. You should be able to set you iPhone OS Deployment Target back to the older SDK version.
This is because Xcode uses weak linking so it will leave out things from the newer SDK on older versions, you do need to do some conditional checking for specific API's/functions using things like respondsToSelector if you are using functionality that has changed across versions.

If I install the 3.0 SDK, can I still make 2.0 compatible apps?

I've been putting off installing the 3.0 beta SDK in case I can't make apps to target 2.0. If I install 3.0 on my computer and iPhone, will I still be able to submit apps to the app store for users with 2.0 iPhones to download? Will I have to wait until 3.0 is released to submit more apps?
Actually, I suggest testing on OS 3.0 as it's a requirement your app doesn't break on the new OS.
"New iPhone applications will be
rejected unless they are ready for
Apple's forthcoming iPhone 3.0
firmware upgrade, developers have been
informed."
You can still build for 2.* but I can see how testing on only one device can make you nervous. There is no way to rollback to a previous OS once 3.0 has been installed. So, if this device is also your everyday cell phone, make sure you accept possible bugs. (though I haven't heard of any seriuous problems. OS 3.0 is worth it)
As for the issue you address. Apple says:
"iPhone SDK for iPhone 3.0 can not be
used for submitting iPhone OS 2.2.1
applications to the App Store."
I think they didn't express themselves too well. While technically spoken, they are right, you just have to select SDK for 2.2.1, and you're good to go.
Yes you can build 2.* apps. No you can't submit pre 3.0 apps to the app store. I can't paste the link for you since I am considered a new user, so just google "iPhone 3.0 app submit".
I understand that you wrote this a while ago and you've already accepted an answer, but I have some more advice:
You should install two copies of the SDK, the latest stable version (in "/Developer") and the latest beta version (in "/Developer Beta" or similar), as per these instructions.
For building 2.x applications, you set your "Base SDK" to 3.0 and your "iPhone OS Deployment Target" to 2.2.1, as per these instructions.
You can get it free or roll back if you do not like the new software at http://www.felixbruns.de/iPod/firmware/
download then follow these steps
1.) after it downloads open itunes and plugin your ipod/iphone
2.) Hold shift if on windows (Option key on mac) and then click resotre
3.) Select the ipod file and then wait for restore
4.) you will need to set up as new ipod (it will be slow if you restore from backup
The installation of the 3.0 SDK mentions weaklinked frameworks --
The Xcode UI now allows you to
designate a library or framework as
weaklinked, to support building with
newer SDKs while targeting older OS
versions.
I have yet to accomplish this, but will update once figured out.