mercredi 24 juin 2015

Request keys from tableview and show them in Custom cell

I have a tableview, the tableview picks up data from a dictionary and shows it in the tableview. I also have a Custom tableview cell. The data which is displayed in the tableview, I need to show that in the custom tableview cell. This is the code from my tableview:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    HistoryTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HistoryViewTableCell"];
    if (cell == nil) {

        NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"HistoryViewTableCell" owner:self options:nil];

        cell = [topLevelObjects objectAtIndex:0];
    }
    NSDictionary * tempDictionary = [tableData objectAtIndex:indexPath.row];
    cell.textLabel.text = [tempDictionary objectForKey:@"PickupAddress"];
    return cell;
} 

I need to show this data in my custom tableview cell. If it's not very clear, please ask and I will try to explain the best I can.

See more ..

Aucun commentaire:

Enregistrer un commentaire