Try en spilt up their Code, no t do all matters in one行。 然后,如果含有正确价值,就会变数。
NSLog(@"Server response: %@",[request responseString]);
NSError * error = nil;
NSDictionary *response = [parser objectWithString:[request responseString] error:&error]
if (!response)( {
NSLog( @"Error parsing JSON: %@", error);
return;
}
NSLog(@"Dictionary: %@", response);
NSNumber *hasValidLicense = [response objectForKey:@"_license"];
NSLog(@"Has valid license: %@", hasValidLicense);
if ([hasValidLicense boolValue]){
//Yes we have a valid license.
} else {
// No valid license.
}