I have a problem parsing JSON string in Objective C: My JSON:
{"messages":[{"nick":"Tim","message":"Hallo","time":"06.07.2012 13:26:41"}]}
My Objective C Code:
NSError *error = nil;
NSData *data = [NSData dataWithContentsOfURL:@"..URL.."];
NSArray *messages = [data objectForKey:@"messages"];
NSDictionary *json = [NSJSONSerialization
JSONObjectWithData:messages
options:NSJSONReadingMutableLeaves
error:&error];
NSString *nick = [json objectForKey:@"nick"];
NSString *message = [json objectForKey:@"message"];
But this doesn´t work and I don´t know what to do!