Прежде всего, это обсуждение не решило мою проблему.
Настройка:
У меня есть массив объектов Person в MainViewController.
Хотите показать объекты в UITableView в AllContactsViewController.
Проблема:
Все работает так, как ожидалось, когда используется UITableViewCell по умолчанию.
Когда я использую свой пользовательский TableCell, я получаю ошибку, указывающую на
что этот класс не соответствует требованиям к кодированию ключа.
Эта ошибка возникает сразу после подключения ЛЮБОГО из моих трех outlets в IB к моему классу TableCell.
Примечание:
TableCell имеет три свойства: a name и email label + imageView.
Надеюсь, что вы сможете помочь.
TableCell.h
#import <UIKit/UIKit.h>
@interface TableCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *emailLabel;
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@end
TableCell.m
#import "TableCell.h"
@implementation TableCell
@synthesize nameLabel, imageView, emailLabel;
AllContactsViewController.m
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdent = @"TableCell";
TableCell *cell = (TableCell *)[tableView dequeueReusableCellWithIdentifier:cellIdent];
if (cell == nil) {
NSArray *array = [[NSBundle mainBundle]loadNibNamed:@"TableCell" owner:self options:nil];
cell = [array objectAtIndex:0];
}
NSString *firstAndLastnameString =
[NSString stringWithFormat:@"%@ %@",
[(NewContact *)[self.allContactsArray objectAtIndex:[indexPath row]] firstName],
[(NewContact *)[self.allContactsArray objectAtIndex:[indexPath row]] lastName]];
cell.nameLabel.text = firstAndLastnameString;
cell.emailLabel.text =
[(NewContact *)[self.allContactsArray objectAtIndex:[indexPath row]] eMail];
cell.imageView.image =
[(NewContact *)[self.allContactsArray objectAtIndex:[indexPath row]] contactPicture];
return cell;
}
UPDATE:
Возможно, скриншот поможет от IB.

Добавлен полный файл AllContactsViewController.h
#import <UIKit/UIKit.h>
#import "VCDelegate.h"
#import "TableCell.h"
@interface AllContactsViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>
@property (weak, nonatomic) id <VCDelegate>delegate;
@property (weak, nonatomic) IBOutlet UITableView *allContactsTableView;
@property (strong, nonatomic) NSMutableArray *allContactsArray;
@property (assign) int currentArrayIndexNumber;
- (IBAction)closeBtnTapped:(id)sender;
@end

