nsstring *version = @"";
nsurl *url = [nsurl urlwithstring:@"http://www.51sjk.com/upload/articles/1/0/323/323233_20220817162716895.jpg app id>"];
versionrequest = [asiformdatarequest requestwithurl:url];
[versionrequest setrequestmethod:@"get"];
[versionrequest setdelegate:self];
[versionrequest settimeoutseconds:150];
[versionrequest addrequestheader:@"content-type" value:@"application/json"];
[versionrequest startsynchronous];
//response string of our rest call
nsstring* jsonresponsestring = [versionrequest responsestring];
nsdictionary *loginauthenticationresponse = [jsonresponsestring objectfromjsonstring];
nsarray *configdata = [loginauthenticationresponse valueforkey:@"results"];
for (id config in configdata)
{
version = [config valueforkey:@"version"];
}
//check your version with the version in app store
if (![version isequaltostring:[itsuserdefaults objectforkey:@"version"]])
{
proalertview *createuserresponsealert = [[proalertview alloc] initwithtitle:@"new version!!" message: @"a new version of app is available to download" delegate:self cancelbuttontitle:@"cancel" otherbuttontitles: @"download", nil];
[createuserresponsealert show];
[createuserresponsealert release];
}
用户登录
还没有账号?立即注册
用户注册
投稿取消
| 文章分类: |
|
还能输入300字
上传中....
嗫?暁雲?