I currently have an dictionary containing 2 objects with separate keys, and I want to populate a table view cell with each object respectively. So say for example my dictionary has 2 objects one with the key north and another object with the key south. Now I want the table view to have 2 cells one containing north and one containing south. How would I go about doing that? so far i tried the code below but that only overrides it.
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"]; if(cell == nil){ cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"Cell"]; } NSMutableDictionary *news = (NSMutableDictionary *)[feeds objectAtIndex:indexPath.row]; [cell.textLabel setText:[news objectForKey:@"frstDirection"]]; [cell.textLabel setText:[news objectForKey:@"secDirection"]]; return cell; }
textLabeltwice with two different values?feeds. That seems correct.feedsthen your values should be in the row specific data. Why is your data setup such that the data for row 0 contains values for both rows and the data for row 1 also contains values for both rows?