Q:

Determine Version of iOS

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? 

A:

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

else if ( [[[UIDevice currentDevice] systemVersion] floatValue] == 5.1)
{
// Do something
}
else
{
// Do something
}

