2012-06-02 90 views

回答

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


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

這是錯誤的註釋中概述的http://stackoverflow.com/a/3341214/118721原因(見接受的答案有一個正確的解決方案)。 – yakovlev

0
float version = [[[UIDevice currentDevice] systemVersion] floatValue];