Я рассмотрел почти все связанные с этим вопросы об этом здесь, в stackoverflow и попробовал все их возможные решения, но я до сих пор не могу понять, почему я получаю эта ошибка:Пользовательский подкласс UITableViewCell: этот класс не является ключевым значением, совместимым с кодировкой
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<CustomCell 0x6e627d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key title.'
Я пытаюсь загрузить настраиваемый вид таблицы ячейку с nibname: @ «CustomCell». Его класс присваивается «CustomCell» (такое же имя класса, как имя nib). Владелец файла также установлен в класс, который загружает эти ячейки - «ProductsTableViewControllerWithSearch». Все выходы в бобах связаны с теми, в CustomCell.m
Вот мой код:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellClassName = @"CustomCell";
static NSString *CellIdentifier = @"Custom Items Cell";
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
NSArray *topLevelItems = [[UINib nibWithNibName:CellClassName bundle:[NSBundle mainBundle]] instantiateWithOwner:self options:nil];
cell = [topLevelItems objectAtIndex:0];
}
//... more irrelevant code here
}
Может кто-нибудь помочь мне, пожалуйста. Я работаю над этим более 4 часов. Большое спасибо!
PS: Я использую ARC, и я для разработки прошивки 5.
Вот мой CustomCell.h.
#import <UIKit/UIKit.h>
@interface CustomCell : UITableViewCell{
UILabel *textLabel;
UILabel *detailTextLabel;
UIButton *starButton;
}
@property (strong, nonatomic) IBOutlet UILabel *textLabel;
@property (strong, nonatomic) IBOutlet UILabel *detailTextLabel;
@property (strong, nonatomic) IBOutlet UIButton *starButton;
@end
Там нет ничего в моем CustomCell.m
Что CustomCell подкласс? – JoePasq
@JoePasq UITableViewCell. – acecapades