Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone check firmware version

HI all

I want to make one app for iPhone 2.2.* and for version 3.0. Some method in 2.2* is deprecated in 3.0. ( like UITableViewCell setText and setLabel )

Is there any way to check which firmware version is used on iPhone and to set different method to use

like image 668
Shyne Avatar asked Mar 06 '26 08:03

Shyne


1 Answers

You will need to use pre-processor directives for the conditional compilation such as __IPHONE_3_0 and build two separate executables.

For example:

 #ifdef __IPHONE_3_0
 // code specific to version 3
 #else
 // code specific to version 2
 #end

If you need to detect the version at run-time you can use [[UIDevice currentDevice] systemVersion]. It returns the string with the current version of the iPhone OS.

like image 174
roustem Avatar answered Mar 08 '26 22:03

roustem



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!