Note that there are some explanatory texts on larger screens.

plurals
  1. POcustom tableviewcell is nil
    primarykey
    data
    text
    <p>I have a table and I want to fill it with custom tableViewCells, in order to provide the user with information on orders. The problem is that the tableview shows the cells but does not fill them with the information I need. When I inserted breakpoints, I found out that the cells are nill, not matter what I do. this is my cellForRowAtIndexPath:</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { OrderOverViewCell *cell = (OrderOverViewCell *)[tableView dequeueReusableCellWithIdentifier: @"orderOverviewCell"]; OrderClass *orderClass = nil; if (filteredArray == nil) { if (sortedArray.count &gt;0) { orderClass = sortedArray[indexPath.row]; } } else if (filteredArray != nil) { orderClass = filteredArray[indexPath.row]; } NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"dd/MM/yyyy HH:mm"]; NSString *orderDate = [dateFormatter stringFromDate:orderClass.orderDate]; cell.orderTitle.text = [NSString stringWithFormat:@"%@%@ %@",orderClass.companyName,@",", orderDate]; cell.orderDetail.text = [NSString stringWithFormat:@"%@ %@ %@ %@.", @"order nummer:",orderClass.orderNumber, @"betaling:", orderClass.orderPaymentType]; if ([orderClass.orderDelivery isEqualToString:@"Bezorgen"]) { cell.orderDelivery.text = [NSString stringWithFormat:@"Levering: Bezorgen op %@, %@, %@", orderClass.orderAdress, orderClass.orderAdressZip, orderClass.orderCity]; } if ([orderClass.orderDelivery isEqualToString:@"Afhalen"]) { cell.orderDelivery.text = [NSString stringWithFormat:@"Levering: Afhalen op ingestelde datum en tijd."]; } cell.orderIndication.image = nil; if ([orderClass.preparing isEqualToString:@"1"]) { if ([orderClass.ready isEqualToString:@"1"] ){ if ([orderClass.delivered isEqualToString:@"1"]){ cell.orderIndication.image = [UIImage imageNamed:@"order_3.png"]; } else { cell.orderIndication.image = [UIImage imageNamed:@"order_2.png"]; } } else { cell.orderIndication.image = [UIImage imageNamed:@"order_1.png"]; } } cell.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"orderCellBG.png"]]; return cell; } </code></pre> <p>Does anybody have an idea what i'm doing wrong? any help would be very appreciated.</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