views:

549

answers:

3

Hi,

I am, as an enrolled developer into iPhone developer program, received a message from apple, requesting to make all applications to be compatible with iPhone os 3.0. It was said that they won't process applications that are incompatible with iPhone os 3.0

The issue is that if I change the code to work with iPhone os 3.0 it won't work on 2.2.1.

For instance sdk 2.2.1 doesn't support the following which is a necessity in sdk 3.0:

cell.textLabel.text = @"text";

In 2.2.1 I would write instead:

cell.text = @"text";

And it's not the only issue.

How do you handle this problem?

Thank you in advance.

+2  A: 

Without going into details about OS 3.0 because of the NDA;

You should check this SO question and answer. It shows how to differentiate between the OS's.

EDIT: I agree with François P.

Kriem
+1  A: 

I'd probably just wrap each of these instances in a conditional based on [[UIDevice currentDevice] systemVersion], which will be an NSString of the form "1.2" "2.0" or "3.0".

If there are lots of instances in your code, abstract through a method or extend the offending class with a category.

Adam Wright
+3  A: 

Without breaking any NDA. Suffice it to say that since most apps currently on the store built to target 2.0 / 2.2.1 will also work under 3.0... You'll understand that even though there might be APIs that will eventually be deprecated it doesn't mean that are effectively deprecated just now. It only means that as you start developing apps specifically targeting 3.0, you should stop using them. In the meantime, you want to continue building for 2.2.1, just like you would if you hadn't heard of 3.0. You'll simply want to test your app on 3.0, but unless you're doing something weird, you shouldn't have any problem.

François P.
Let me add that you really should'nt add some code that will branch depending on software version... it just makes code paths that much harder to debug and test.
François P.