Ładowanie podklasy UITableViewCell przy użyciu pliku XIB

Mam problem z dostaniem sięCustomTableViewCell, podklasaUITableViewCell pojawiać się w widoku tabeli.

Używam xib do reprezentowania tej komórki, ale zakładam, że kod delegata źródła danych nie ulega zmianie. Upewniłem się, że ustawiłem identyczny identyfikator ponownego użycia wewnątrz komórki widoku tabeli XIB.

Wyizolowałem problem na fakt, że metoda źródła danych, która zwraca komórkę tabeli, nie działa poprawnie, tutaj:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    CustomTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    DataObject *foo = [self.dataArray objectAtIndex:indexPath.row];

    if (cell == nil) 
    {
        cell = [[CustomTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }

    [[cell overview] setText:foo.overview];
    [[cell price] setText:foo.price];
    NSLog(@"cell initialized, description text is %@",cell.overview.text);

    return cell;
}

Nie wiem, dlaczego to nie działa, ale ta ostatnia instrukcja dziennika zawsze drukuje (null) na końcu i tak, sprawdziłem, żeoverview właściwość obiektu danych zawiera poprawny ciąg. To samo dotyczyprice.

questionAnswers(2)

yourAnswerToTheQuestion