views:

134

answers:

2

How to get image from server using JSON parser. plz if possible post piece of code. Thnks in advance..

A: 

I use json-framework from Google Code. The URL is: json-framework.

jwkpiano1
A: 

my code is here:

NSString *jsonString = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding]; NSDictionary *results = [jsonString JSONValue]; NSArray *photos = [results objectForKey:@"ImageData"]; for (NSDictionary *ImageData in photos) {
NSString *name = [ImageData objectForKey:@"name"]; label.text = name; //NSData *data = [ImageData objectForKey:@"src"];
//UIImage *imgs = [[UIImage alloc] initWithData:data]; //img.image = [[UIImage alloc]initWithData:[ImageData objectForKey:@"src"]];
} commentted code lines not showing image..then how to display image?? Im also using json framework from Google code.. thanx

xcodemaddy