如何检查iOS版本?

我想检查设备的iOS版本是否大于3.1.3
我试过这样的方法:

[[UIDevice currentDevice].systemVersion floatValue]

但它不起作用,我只想要一个:

if(版本>3.1.3){

我怎样才能做到这一点

/*
*系统版本控制预处理器宏
*/ 
#将系统版本定义为(v)([[[UIDevice currentDevice]systemVersion]比较:v选项:NSNumericSearch]==NSOrderedName)
#定义系统版本\大于(v)([[[UIDevice currentDevice]systemVersion]比较:v选项:NSNumericSearch]==传感器降级)
#将系统版本定义为大于或等于(v)([[UIDevice currentDevice]systemVersion]比较:v选项:NSNumericSearch]!=传感器解除搜索)
#定义系统版本小于(v)([[[UIDevice currentDevice]systemVersion]比较:v选项:NSNumericSearch]==传感器解除搜索)
#定义系统版本小于或等于(v)([[UIDevice currentDevice]系统版本]比较:v选项:NSNumericSearch]!=传感器降级)
/*
*用法
*/ 
如果(系统版本小于(@“4.0”)){
...
}
如果(系统版本大于或等于(@“3.1.1”)){
...
}

发表评论