我的 if 语句不起作用。active
返回 1 但在IF statement
JSONDecoder *jsonKitDecoder = [JSONDecoder decoder];
NSDictionary *dict = [jsonKitDecoder objectWithData:jsonData];
NSString *userid = [dict valueForKeyPath:@"users.user_id"];
NSString *active = [dict valueForKeyPath:@"users.active"];
NSLog(@"%@",userid); // 2013-06-20 03:03:21.864 test[81783:c07] (74)
NSLog(@"%@",active); // 2013-06-20 03:03:21.864 test[81783:c07] (1)
if ([active isEqualToString:@"1"]){
// Do something
}
我似乎无法让它IF
工作。我需要将 更改NSString
为int
吗?