J'essaye de construire une vue de table personnalisée en utilisant une cellule que j'ai construit dans IB. Je reçois une erreur étrange:Personnalisé UITableViewCell erreur
<BroadcastViewController 0x4b4f5f0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key postText.
Tout est câblé correctement dans IB au contrôleur de cellule. Pas vraiment sûr pourquoi cela se passe.
C'est ce que mon cellForRowAtIndexPath ressemble:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//Get the folder object of interest
Broadcast *messageAtIndex = [self.messages objectAtIndex:indexPath.row] ;
static NSString *CellIdentifier = @"BroadcastTableViewCell";
static NSString *CellNib = @"BroadcastTableViewCell";
BroadcastTableViewCell *cell = (BroadcastTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
//ERRORING ON THIS LINE...
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:CellNib owner:self options:nil];
cell = (BroadcastTableViewCell *)[nib objectAtIndex:0];
}
cell.postText.text = messageAtIndex.replyText;
cell.authorName.text = messageAtIndex.postCreatorFirstName;
cell.postDate.text = messageAtIndex.creationDate;
return cell;
}
Tout le monde voit ce genre d'erreur avant? Faites-moi savoir si vous avez besoin de plus d'informations ...
Besoin de code complet pour la fonction cellForRowAtIndexPath – SegFault
A été mis à jour. – gabaum10
On dirait que vous essayez d'insérer une valeur pour 'postText' dans quelque chose qui n'est pas un NSDictionary? :) – willcodejavaforfood