大佬教程收集整理的这篇文章主要介绍了iphone – 根据应用商店中的最新版本,最简单的方法来检查当前版本的应用程序?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
NSURL * url = [NSURL URLWithString:@"http://yourweb.com/version.txt"]; NSURLrequest * request = [NSURLrequest requestWithURL:url cachePolicy:NSURLrequestReturnCacheDataElseLoad timeoutInterval:60]; _connection = [[NSURLConnection alloc] initWithrequest:request delegate:self];
然后在您的委托实施中:
(void)connection:(NSURLConnection*)connection didReceiveResponse:(NShttpURLResponse*)response { if(response.statusCode != 200) // you got an error } - (void)connection:(NSURLConnection*)connection didFailWithError:(NSError*)error { // again with the errors ... } // you got some data ... append it to your chunk // in your case all the data should come BACk in one callBACk - (void)connection:(NSURLConnection*)connection didReceiveData:(NSData*)data { [mData appendData:data]; } - (void)connectionDidFinishLoading:(NSURLConnection *)connection { // your request finished ... check the version here }
所以在你的connectionDidFinishLoading你看看你收集的mData.解析出版本号并将其与您的捆绑版本号进行比较:
[self infoValueForKey:@"CFBundLeversion"];
以上是大佬教程为你收集整理的iphone – 根据应用商店中的最新版本,最简单的方法来检查当前版本的应用程序?全部内容,希望文章能够帮你解决iphone – 根据应用商店中的最新版本,最简单的方法来检查当前版本的应用程序?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。