// 获取app版本
NSString *app_Version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];

版本号判断方法:

//输出YES(服务器大与本地) 输出NO(服务器小于本地)
- (BOOL)compareEditionNumber:(NSString *)serverNumberStr localNumber:(NSString*)localNumberStr {
//剔除版本号字符串中的点
serverNumberStr = [serverNumberStr stringByReplacingOccurrencesOfString:@"." withString:@""];
localNumberStr = [localNumberStr stringByReplacingOccurrencesOfString:@"." withString:@""];
//计算版本号位数差
int placeMistake = (int)(serverNumberStr.length-localNumberStr.length);
//根据placeMistake的绝对值判断两个版本号是否位数相等
if (abs(placeMistake) == 0) {
//位数相等
return [serverNumberStr integerValue] > [localNumberStr integerValue];
}else {
//位数不等
//multipleMistake差的倍数
NSInteger multipleMistake = pow(10, abs(placeMistake));
NSInteger server = [serverNumberStr integerValue];
NSInteger local = [localNumberStr integerValue];
if (server > local) {
return server > local * multipleMistake;
}else {
return server * multipleMistake > local;
}
}
}

代码跳转AppStore:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"app路径链接"]];

iOS关于版本更新的问题的更多相关文章

  1. iOS 检测版本更新(02)

    iOS 检测版本更新 如果我们要检测app版本的更新,那么我们必须获取当前运行app版本的版本信息和appstore 上发布的最新版本的信息. 当前运行版本信息可以通过info.plist文件中的bu ...

  2. iOS - Harpy版本更新工具兼容版本第三方库

    Harpy(兼容版) git地址:https://github.com/yangchao0033/Harpy ###(iOS5-9适配版本,基于ArtSabintsev/Harpy v3.4.5) 提 ...

  3. iOS检测版本更新

    有时候为了需求,我们需要检测app版本更新今天在这里整合下 //获取当前版本号 NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDi ...

  4. iOS软件版本更新思路

    iOS软件更新思路 需要更新版本数组 needUpdateVersions{1.2.61.2.8} 历史版本数组 historyUpdateVersions1.2.41.2.51.2.6 更新数据库1 ...

  5. ios检查版本更新

            场景 在我们使用应用时,一打开应用,如果此应用有新的版本,常常能在应用中给出提示,是否要更新此应用.所以,我们就来看看,版本更新是如何实现的. 应用 苹果给了我们一个接口,能根据应用i ...

  6. iOS 检测版本更新

    如果我们要检测app版本的更新,那么我们必须获取当前运行app版本的版本信息和appstore 上发布的最新版本的信息. 当前运行版本信息可以通过info.plist文件中的bundle versio ...

  7. ios 实现版本更新检查

    注:这里网络请求用的是第三方框架:SVHTTPRequest /* 第一步: 根据应用名称搜索应用,然后根据应用绑定的ID在结果中筛选出我们要找的应用,并取出应用的AppID */ - (void)g ...

  8. iOS APP版本更新跳转到App Store下载/更新方法

    使用下面的连接即可跳转到App Store itms-apps://itunes.apple.com/cn/app/id***********                  其中********* ...

  9. iOS应用版本更新(自动提醒用户更新代码)

    在#import "AppDelegate.h" 文件中的application:(UIApplication *)application didFinishLaunchingWi ...

随机推荐

  1. iOS:开发常用GitHub开源项目(持续更新)

    IOS开发常用GitHub开源项目(持续更新) 数据类 开源库 作者 简介 AFNetworking Mattt 网络请求库 ASIHTTPRequest pokeb 网络请求库 Alamofire ...

  2. glsl水包含倒影的实现(rtt) 【转】

    http://blog.sina.com.cn/s/blog_78ea87380101eixi.html 此文实现一个简单地水面倒影效果,通过rtt相机 获取倒影纹理, 水的基本实现方法(参考前一博文 ...

  3. 一步一步学RenderMonkey(4)--点光源光照模型 【转】

    转载请注明出处:http://blog.csdn.net/tianhai110 点光源光照模型: 公式: I = Icolor*attenuation;                        ...

  4. 数组类型参数传递问题:$.ajax传递数组的traditional参数传递必须true

    数组类型参数传递: 若一个请求中包含多个值,如:(test.action?tid=1&tid=2&tid=3),参数都是同一个,只是指定多个值,这样请求时后台会发生解析错误,应先使用 ...

  5. Java中PriorityQueue详解

    Java中PriorityQueue通过二叉小顶堆实现,可以用一棵完全二叉树表示.本文从Queue接口函数出发,结合生动的图解,深入浅出地分析PriorityQueue每个操作的具体过程和时间复杂度, ...

  6. [Functional Programming Monad] Apply Stateful Computations To Functions (.ap, .liftA2)

    When building our stateful computations, there will come a time when we’ll need to combine two or mo ...

  7. Linux配置虚拟主机后,只能访问到主页怎么办?

    Linux配置虚拟主机后,只能访问到主页怎么办? 今天配置了lamp后,添加了一个虚拟主机,配置http.conf后,增加虚拟主机,测试访问发现只有域名下能访问,ljt.com但是域名下所有的都访问不 ...

  8. .htaccess 文件中详细介绍

    #如果存在rewrite_module 模块则执行里面的代码 <IfModule rewrite_module> #开启重写机制 RewriteEngine On #告诉apache这里不 ...

  9. Twelves Monkeys (multiset解法 141 - ZOJ Monthly, July 2015 - H)

    Twelves Monkeys Time Limit: 5 Seconds      Memory Limit: 32768 KB James Cole is a convicted criminal ...

  10. ECMAScript6 | 新特性(部分)

    新特性概览 参考文章:http://www.cnblogs.com/Wayou/p/es6_new_features.html 这位前辈写的很好,建议深入学习 ———————————————————— ...