mercredi 24 juin 2015

Show data in Custom tableview Cell

I am new to developing. i have some experience but i'm not great at it (yet). I'm working on this tableview app which shows data. I want to show that data in a custom cell. But i don't know how to do that. This is the code i use for 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 line of code in my custom cell.

cell.textLabel.text = [tempDictionary objectForKey:@"PickupAddress"];

I already made a class and a xib file for the custom cell

See more ..

Aucun commentaire:

Enregistrer un commentaire