IPhone SDK 3.0 Vs. 2.2.1

I just installed the iPhone SDK 3.0 and found that the text property of UITableViewCell is no longer in use, and textLabel.text should be used instead. Does this mean that I should know the current version of the system and call the appropriate method? like this.

UITableViewCell *cell = ...; if ([[[UIDevice currentDevice] systemVersion] isEqualToString:@"3.0"]) { cell.textLabel.text = @"..."; } else { cell.text = @"..."; } 

If so, it will be very unpleasant.

+4
source share
6 answers

Just create for version 3.0 and no longer worry about 2.2. Unlike major OS updates, people updated very quickly to the new version of iPhone OS. Check out this TapBots blog post: iPhone 3.0 Pay Speed .

By the time your application is approved (in 2 weeks + some?), Almost no one will use 2.2 anymore!

+3
source

Instead of checking the OS version, you can check if the cell has a new property:

 if ([cell respondsToSelector:@selector(textLabel)]) { // Do it the 3.0 way cell.textLabel.text = @"..."; } else { // Do it the 2.2 way, but avoid deprecation warning [cell performSelector:@selector(setText:) withObject:@"..."]; } 
+4
source

You can use SDK 3.0 and use an older version for your projects, for example 2.2 or 2.2.1.

To do this, you install the base SDK in 3.0, but change your iPhone OS deployment target setting. Both settings are available if you receive project information.

+1
source

This is deprecated, and they offer a new way, but you can certainly still use method 2.2 if you want, and this will not adversely affect your application running on 3.0. If you are worried that users still on 2.2 are sure to check the ben link. I do not think this will be a big problem if you compile for version 3.0.

+1
source

Actually, I don’t think you need to do this, because when you build your project, you choose what kind of firmware it targets, as indicated in pgb. Then you can simply use the #ifdef directives. Here is more detailed information: iPhone firmware version for iPhone A more detailed answer is available here: How to target a specific iPhone version?

EDIT : I deleted some text after I realized that systemVersion is actually a string, source: Docs UIDevice .

If you will use it in different files in your project, you can organize it by adding it as a property to your appdelegate, and they will get the value by doing something like this:

 MyAppDelegate *theDelegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate]; NSString *version = theDelegate.version; 

But that might be too confusing for something as simple as the version number.

0
source

If you decide to stick with 2.2 at the moment, be sure to check in simulator 3.0. We saw strange behavioral differences between 2.2 and 3.0, especially with tables.

0
source

All Articles