我正在尝试选择返回字符串的某个部分用作 isEqual。
guest_user_id = [[NSMutableString alloc]initWithData:[APIv2 Guest_Sign_Up:guest_email] encoding:NSUTF8StringEncoding];
guest_user = [guest_user_id JSONValue];
appDelegate.guest_user_id = guest_user [@"id"];
NSData *jsonData = [guest_user_id dataUsingEncoding:NSUTF8StringEncoding];
NSError *e;
NSMutableDictionary *jsonList = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&e];
NSLog(@"jsonList: %@", jsonList[@"success"]);
if([jsonList [@"success"] isEqualToString:@"0"]){
API的返回看起来像这样......
Return: {"success":0,"error":"That email address is already registered! Please try again or login."}
它不会看到它是错误的,只是去其他地方。有任何想法吗?!:)