iOS is forward compatible or backwad compatible - iphone

I would like to know whether iOS apps are forward or backward compatible.
If I design an app in iOS4 can it be run on iOS5.
Android is forward compatible, can be built on SDK 1.6 and the same app can be run on newer versions of Android Operating Systems.
How about the iOS?

I would say it is. But you should always check your apps when a new version of the framework is released.
I remember that some of my old apps crashed when I updated to iOS 5.
The question have been answered before here.

Yes it would work. Although you should check if certain methods have been deprecated, or changed in some way, so for instance you might be able to use a method on iOS4 and that method been changed in some way in iOS5. The same is true for backward compatibility, certain classes only appeared on iOS5, and you will have crashes when using those on iOS4. Bottom line: test on both version your application.
There a couple of question/answers regarding this topic:
Pitfalls when writing an iOS app supporting iOS 3.1.3 and iOS 4.x
Recommended way to support backward/forward compatibility in iPhone app?

Generally speaking, this is true. There are some exceptions though, and the only way to be sure is to test the app on different versions.
A big difference with Android though is that most handsets are up-to-date with the latest OS, so if you are starting a new project you should probably consider targeting iOS5.

Related

iOS app maximum iOS version support

I have developed my app in Xcode 4.1 and iOS SDK version(Base SDK Version) is iOS 4.3 So, will this app run on iPhone with iOS 5 and/or iOS 6 or not?
I think the app can be run on a higher version of the OS than the Deployment Target. Is this right? I appreciate any help.
Yes, your app will run on anything that is iOS 4.3 or newer. That is, assuming you aren't using any depreciated methods that are removed from a future iOS release. You can check if things have been depreciated/removed through the documentation.
It doesn't matter with which Xcode you build your app, the base SDK signifies the lowest system your app is supporting.
You app can and will run on newer systems.
If you want to make an update to your app, you'll need to pay attention to depreciated methods for the newer systems or you will get rejected and won't be able to update in the App Store.
Yes, it will for sure run in higher versions than Deployment Target.
However, is always recommended to run also in newer versions as they are released, to check that every API used is still running fine (specially if they were deprecated).

Target iOS Level with Xcode for Backward Compatability

I did a search here already, and haven't found a clear answer to my question, so I thought the time was right to post.
I have an iOS application that was developed using Xcode 3.2 and SDK 4.2. When I built the bundle, I targeted iOS 3, so that people running older iPhones (like my wife who has iPhone 3 with iOS 3.x on it) can run the application. The app was also tested on, and runs fine with, the latest 4.x iOS.
With the release of iOS 5, I want to make sure my app is compatible. There is nothing new in iOS 5 that my app uses. I have installed the latest version of Xcode and iOS SDK. My question is this : if I rebuild my app using this new Xcode/SDK combination, and set the target iOS level to something older than 5, for backwards compatibility, this still means that my application is built for, and is thus compatible with, iOS5, correct? I will of course test it with iOS 5, but I want to be able to claim it's supported on iOS5, while still maintaining backwards compatibility.
Do I understand correctly how this works?
Thanks!
Mark
Yes, that's no problem. You should always build with the latest SDK but if you set your Deployment Target to, let's say, 4.2 (which is common for many apps), or even 3.0, as you intend to do, of course it will run under iOS 5.
Testing it will still be wise since there are some changes that might lead to bugs in iOS 5, but in general, it shouldn't be a problem.

What sdk version of iPhone app should I use? 4.2 or 3.?

Should I be developing my app for 4.2?
Always use the latest SDK. Apple won't approve any apps built against 3.x anymore.
Edit:
There's a difference between the base SDK and the iOS you plan to support. You need to use the latest SDK as I stated before, however you may still create an app that runs on older versions of iOS by not using classes and methods that have been introduced in newer releases and setting the target OS appropriately.
Unless you have the need to support older iOS devices with older iOS versions, you should develop using 4.2 as it has a lot of features that are missing in 3.x. Most importantly: 3.x doesn't support multitasking.
Also, it's important to understand the relationship between Base SDK version and deployment target. In a nutshell: you can (and should) compile against the latest SDK version but if done correctly, you can still run the app on older iOS versions.
The base SDK should always be the latest version available (4.2 as of right now). Then you can use the deployment target to specify the minimum OS that your application will support, so a good rule of the thumb would be to use 3.0 for that.
Personally, I use some of new iOS 4.0 stuff (ie. GCD) a lot in my applications. I've heard that 90% of ios users are on 4.x. That should be a good middle ground.

Testing iPhone apps in iOS 3.0

Officially Apple let developers deploy apps that's compatible with iOS 3.0 to iOS 4.2. However there are some APIs and some hardware features that's not present in some devices or in some iOS versions.
However if you only have one testing device, and you want to try to install a clean iOS 3.0 to that, for testing purposes, what is the official way to do it? I tried looking all over Apple developer website and it does not give me anything.
I asked a similar question before: A TimeMachine taking my iDevice back to 3.1.2?
After that I did a thorough research on this topic. It finally turned out, that actually there is no official way for a developer to downgrade her or his own device back to an earlier iOS. Apple just doesn't allow that to happen.
However, in your code, there are many things you can do to make sure your app is supported in an old version iOS. Check this great post: http://cocoawithlove.com/2010/07/tips-tricks-for-conditional-ios3-ios32.html
If testing on the iOS Simulator is enough, you can achieve that by installing previous versions of the SDK which contains the older versions of iOS.
As for device, there is no quick way to switch between iOS versions on a single device.
I struggled with this for a while, and eventually gave up on downgrading and bought a used 1st gen iPod Touch, which can't be upgraded to 4.x so it's guaranteed to be 2.x or 3.x (2.x is easily upgraded to 3.x).
Now I test on that. Added benefit is that when testing on it you're at the same time checking the performance on a slower (slowest?) iOS device too.

Does supporting multitasking in iOS 4 mean dropping support for iOS 3?

I can't find anywhere definitively, if you build an app against the iOS 4 SDK, to thus support multitasking, does that mean the app won't work in iOS 3? If not, how can you support iOS features like multitasking but still support iOS 3? I'm sorry if there are Apple docs on this, I'm happy to read them, I just can't find them. Thank you
You can build against a 4.x Base SDK, and set the Deployment Target to 3.x.
But you have to make sure not use any of the new 4.x APIs without checking for their availability first (or you will start to run, then crash as soon as you call one of those APIs on a device running 3.x). And you will need to test thoroughly on an actual device running iPhone OS 3.x since there is no simulator support for this kind of OS portability testing.
In some cases, converting a 3.x app to also allow what is called "multitasking" under 4.x is as easy as rebuilding the app using a new 4.x Base SDK, but leaving the deployment target where it was at 3.x, and adding an applicationWillResignActive: delegate to handle both suspend and potential termination.
No it does not. iOS 3 just ignores the delegate methods that get called.
However, if you try and launch a background task, you'll have to check for the API first, otherwise yeah, you'll not run on 3.