获取iOS系统版本,谨慎使用[[[UIDevice currentDevice] systemVersion] floatValue]
时间:2015-06-08 11:40:00
收藏:0
阅读:384
iOS 最常见的获取系统版本号的方法是:
[[[UIDevice currentDevice] systemVersion] floatValue]
但是,这个floatValue是不靠谱的,这也算是iOS SDK的一个bug吧。看一下上面的函数在8.2系统上的表现。
如果代码中有 if( version >= 8.2) 的判断,则该判断会失效!
所以,还是使用字符串对比版本号比较靠谱。
原文:http://blog.csdn.net/hherima/article/details/46409247
评论(0)