Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I display Array of NSMutableDictionary data in UITableView?
    primarykey
    data
    text
    <p>I am new to iPhone Development. My app is sending URL request to retrieve data from server by using <code>NSURLConnection</code>. I'm getting data in <code>JSON</code> format and I'm storing it in <code>NSMutableArray</code> as array of dictionaries. So I have an array of dictionaries. I need to display specific data in <code>UITableViewCell</code>.</p> <p>My code is Here...</p> <pre><code>-(IBAction)ButtonTapped:(id)sender { NSString *strURL=[NSString stringWithFormat:@"URl Name here"]; NSURL *url=[NSURL URLWithString:strURL]; self.request=[NSURLRequest requestWithURL:url] self.nsCon=[[NSURLConnection alloc] initWithRequest:request delegate:self]; if(self.nsCon) { self.receivedData=[[NSMutableData alloc] init]; } else { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error",@"") message:NSLocalizedString(@"Not Connected Other View !!",@"") delegate:nil cancelButtonTitle:NSLocalizedString(@"OK",@"") otherButtonTitles:nil]; [alert show]; [alert release]; } } - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { // receivedData is an instance variable declared elsewhere. [receivedData setLength:0]; } - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { // Append the new data to receivedData. // receivedData is an instance variable declared elsewhere. [receivedData appendData:data]; } - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { // inform the user UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error",@"") message:NSLocalizedString(@"Connection failed !!",@"") delegate:nil cancelButtonTitle:NSLocalizedString(@"OK",@"") otherButtonTitles:nil]; [alert show]; [alert release]; } - (void)connectionDidFinishLoading:(NSURLConnection *)connection { NSString *responseString = [[NSString alloc] initWithData:self.receivedData encoding:NSUTF8StringEncoding]; self.theDictionary= [[NSMutableDictionary alloc] init]; self.theDictionary = [responseString JSONValue]; self.arrofDictionary=[[NSMutableArray alloc] init]; [self.arrofDictionary addObject:self.theDictionary]; NSLog(@"data length - %@ ",[self.theDictionary objectForKey:@"today"]); // release the connection, and the data object [connection release]; [receivedData release]; self.tblList=[[UITableView alloc] initWithFrame:CGRectMake(0,80,320,370) style:UITableViewStyleGrouped]; self.tblList.delegate=self; self.tblList.dataSource=self; [self.view addSubview:self.tblList]; } </code></pre> <p>// data display in consol </p> <pre><code>( { "date_time" = "2012-08-31 09:30:25"; id = 99; language = en; name = Tt; score = 656; }, { "date_time" = "2012-08-31 10:08:52"; id = 103; language = en; name = Fg; score = 567; }, { "date_time" = "2012-08-31 08:22:38"; id = 87; language = en; name = Eree; score = 565; }, ) </code></pre> <p>Then how can I display <strong>name</strong> and <strong>score</strong> on <code>UITableViewCell</code> ?? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload