我正在使用 if else 条件来检查变量,但是当 value 为 true 时它也总是运行 else 然后它也显示 else
NSString *data=[[NSString alloc]initWithData:urlData encoding:NSUTF8StringEncoding];
NSLog(@"%@",data);
if ([data isEqualToString:@"Yes"]) {
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Welcome" message:@"Successful Login" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
else {
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Incorrect user name or password" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}