Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Alhazred

macrumors member
Original poster
Jul 5, 2011
35
0
I'm creating a simple app which asks to the user to put a text inside a text field, this text is sent to a php script on an application server, the script performs a search on a database and send the result back to tha app formatted as JSON

With this code I print the response into the console
Code:
NSString *response = [[[NSString alloc] initWithData:dati encoding:NSASCIIStringEncoding] autorelease];
NSMutableArray *jsonarray = [response JSONValue];
for (int i=0; i<[jsonarray count]; i++) {
	NSLog(@"jsonarray: %@", [jsonarray objectAtIndex:i]);
}
Data in the console appear like this
Code:
2011-07-05 09:45:51.632 RecuperoInfo[20391:207] jsonarray: {
    img = "barca.jpg";
    testo = "Una barca";
}
2011-07-05 09:45:51.637 RecuperoInfo[20391:207] jsonarray: {
    img = "form.jpg";
    testo = "Immagine di una form";
}
2011-07-05 09:45:51.646 RecuperoInfo[20391:207] jsonarray: {
    img = "bmw.jpg";
    testo = "Una BMW";
}
How do I print only the values and not the keys?

In example I want to print this:
barca.jpg - Una barca
form.jpg - Immagine di una form
bmw.jpg - una BMW
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.