0

Possible Duplicate:
Check iPhone iOS Version

I am trying to setup some code that is different on iOS 5.0.1 than it is one iOS 5.1 and higher. Is there an if statement to determine it or not?

0

2 Answers 2

0
   if ( [[[UIDevice currentDevice] systemVersion] floatValue] == 5.0)
{
// Do something
}


else if ( [[[UIDevice currentDevice] systemVersion] floatValue] == 5.1)
{
// Do something
}
else
{
// Do something
}
Sign up to request clarification or add additional context in comments.

1 Comment

This is wrong for reasons outlined in comments to stackoverflow.com/a/3341214/118721 (see the accepted answer there for a correct solution).
0
float version = [[[UIDevice currentDevice] systemVersion] floatValue];

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.