With iOS4 coming out soon, I have already planned to include an iAd in a future update of an app of mine. I assume that this will make my app unusable for anyone on a firmware lower than 4.0. Is there a way to change that variables and the .xib file based on the user's firmware? Cheers.
views:
3520answers:
2
+29
A:
Yes, you can build with 4.0 SDK and still run on devices with earlier versions of the firmware.
- Set your Deployment Target to the earliest version you want to be able to run with, ie: 3.0.
- You set your Base SDK to the latest version that you are compiling with, ie: 4.0. This way you can reference the newer definitions and symbols in your code. This article "SDK and Deployment Targets" discusses Deployment vs Base SDK in detail.
- Weak link to the libraries/frameworks with symbols that are only available in the newer iOS. This is so your app will run on a device that doesn't have the newer symbols.
- You must check to see that a newer method is available before calling it. You have to make sure not to call a method that is 4.0 only when your app is on a < 4.0 device. Of course you have to gracefully handle working on older versions by either using older methods or not supporting particular features that need newer SDK support.
See these SO questions and answers for more details:
progrmr
2010-06-12 02:12:07
So what happens to the iAd delegate's methods?? Will they fire an error?
Red Serpent
2010-07-01 13:51:27
Yes, they would error. You can't display iAd's on anything lower than iOS 4. You would need to do some kind of conditional ifdef checking so that iAd's aren't attempting to be shown on iOS 3.x
JonB
2010-08-09 14:20:34
A:
I am getting stuck with this! If I install SDK 4 on my machine I lose all targets prior to 3.2?
I have then followed advice re install SDK's in different folders but now as I have IOS4 on my iPhone I have to keep bouncing between SDKs?
What do I need to do to get all targets prior to 3.2 visible in SDK 4?
Thanks
user7865437
2010-06-24 09:38:02