-(void) Initcheckversionwithdata: (NSData *) data
{
NSData *xmldata = data;
NSString *result = [[NSString alloc] Initwithdata:xmldata encoding:nsutf8stringencoding];
NSLog (@ "result:%@", result);
Getcheckversion *parser = [[Getcheckversion alloc] initwithxmldata:xmldata];
[Parser parse];
NSString *status = parser.tempResult.status;
NSLog (@ "status:%@", status);
if ([@ "201" Isequaltostring:status]) {
NSLog (@ "version does not need to update, OK");
}
else if ([@ "isequaltostring:status]) {
Uialertview * Alertview = [[Uialertview alloc] initwithtitle:@ "Prompt" message:@ "update Version" Delegate:self cancelbuttontitle:@ " Cancel "otherbuttontitles:@" OK, nil];
[Alertview show];
[Alertview release];
Alertview = nil;
}
}
-(void) Alertview: (Uialertview *) Alertview Clickedbuttonatindex: (Nsinteger) Buttonindex
{
NSString *msg = [[NSString alloc] initwithformat:@ "You clicked on the%d button!", Buttonindex];
NSLog (@ "msg:%@", msg);
if (Buttonindex = = 0) {
Return
}else if (Buttonindex = = 1) {
[HttpClient getupdateversion];
}
}