IOS 中获取系统版本,比较简单([[UIDevice currentDevice] systemVersion]);
看到网络上很多转化系统字符串到float 的方法,都是使用 [[[UIDevice currentDevice] systemVersion] floatValue];
但是这个方法我遇到一个问题,就是如果系统版本是7.1.1 的时候,转化生成的float 有问题,我debug 生成的数据为7.0899999999999。导致出现了问题,
后来为了解决这个问题,我自己写了一个方法。
+ (CGFloat )systemVersion{
NSString *sVersion = [[UIDevice currentDevice] systemVersion];
NSRange fRange = [sVersion rangeOfString:@"."];
CGFloat version = 0.0f;
if(fRange.location != NSNotFound){