I continue to get this error when I try to deserialize the JSON code that is printed out in the web service.
This is what is being printed out in php:
[{"reply":"yes","admin1":"1066","admin2":"1635"}]
This is my code in objective c to deserialize the json:
NSMutableString *loginString = [NSMutableString stringWithString:kLoginURL];
[loginString appendString:[NSString stringWithFormat:@"?username=%@",username.text]];
[loginString appendString:[NSString stringWithFormat:@"&password=%@",password.text]];
[loginString setString:[loginString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSLog(@"%@",loginString);
NSURL *url = [NSURL URLWithString:loginString];
//NSError *error1;
NSData *data = [NSData dataWithContentsOfURL:url ];
//NSLog(@"%@",data);
// NSLog(@"error %@",error1);
NSError *error;
json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
NSLog(@"json error: %@",error);
NSLog(@"%@",json);
NSDictionary *info = [json objectAtIndex:0];
NSLog(@"%@",info);
NSString *reply = [info objectForKey:@"reply"];
NSLog(@"%@",reply);
Please let me know if there is anything wrong with this code or the format of JSON