I got JSON dictionary, but i want to get in this son values. like NAME, SECTION,CLASS,IMAGE,DOB. how to get values and mostly how to get image by this bit code. how to show image and convert bit code to image. please help
my Json
[
{
"ID": "1000710017",
"CLASS": "1",
"SECTION": "A",
"NAME": "testing",
"DOB": "123\/123\/999",
"IMAGE": "iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAB0N0lEQVR4Xu29B4BdR3U+PpJWuytp1btly7ItueAOuGAwNqbYGIMN+BdCgOBACDFOQgkB0sg\.......so big code"
}
]
my code
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
NSLog(@"get id %@",self.uid_value);
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://sixthsenseit.com/school/project/ios/profile.php"]];
//create the Method "GET" or "POST"
[request setHTTPMethod:@"POST"];
//Pass The String to server(YOU SHOULD GIVE YOUR PARAMETERS INSTEAD OF MY PARAMETERS)
NSString *userUpdate =[NSString stringWithFormat:@"id=%@&",_uid_value, nil];
//Check The Value what we passed
// NSLog(@"the data Details is =%@", userUpdate);
//Convert the String to Data
NSData *data1 = [userUpdate dataUsingEncoding:NSUTF8StringEncoding];
//Apply the data to the body
[request setHTTPBody:data1];
//Create the response and Error
NSError *err;
NSURLResponse *response;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err];
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:responseData
options:kNilOptions
error:&err];
NSString *resSrt = [[NSString alloc]initWithData:responseData encoding:NSASCIIStringEncoding];
//This is for Response
NSLog(@"got response==%@", resSrt);
if (json)
{
NSArray *results = [json valueForKey:@"NAME"];
}
if(resSrt)
{
NSLog(@"got response");
}
else
{
NSLog(@"faield to connect");
}
}