I think this is simple but I can’t make it work..
I have a text field, where I enter a String… Then I send it to a web service.
I get the JSON and parse it.
- (void)requestFinished:(ASIHTTPRequest *)request
// some code ::::::
NSLog(@"OkRequest || %@ ", jsonDictionary);
for (NSDictionary *ville in jsonDictionary)
{
NSString *title = [ville objectForKey:@"label"];
NSLog(@"%@", title);
}
I make the NSDictionary, but when I want to set it into a table View… I don’t know how to send that Dictionary to another method.
Declare a class member
NSDictionary *_jsonDict;In
requestFinished:method, assign the value to the class member and retain that. Then reload the table view as[self.tableView reloadData];In your
cellForRowAtIndexPath:method, get the value from the dictionary and set it to the label.Update: