//处理4.4.3变成4.43
- (CGFloat )systemVersion:(NSString *)verSionStr{
NSRange fRange = [verSionStrrangeOfString:@"."];
CGFloat version =0.0f;
if(fRange.location !=NSNotFound){
verSionStr = [verSionStr stringByReplacingOccurrencesOfString:@"."withString:@""];
NSMutableString *mVersion = [NSMutableStringstringWithString:verSionStr];
[mVersion insertString:@"."atIndex:fRange.location];
version = [mVersion floatValue];
}else {
version = [verSionStr floatValue];
}
return version;
}
//版本更新 本地版本小于服务器版本
([self systemVersion:[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey]]<[self systemVersion:[completedOperation.responseJSON objectForKey:@"result"]]) {
本文介绍了一种将iOS系统版本号字符串转换为浮点数的方法,以便于进行版本比较。通过去除版本号中的点号并重新插入以形成正确的浮点数格式,可以方便地判断两个版本之间的大小关系。
1806

被折叠的 条评论
为什么被折叠?



