Я сделал настраиваемое представление для TableCell, у меня есть некоторые элементы в клетке, я закодирован правильное IBOutlet разных цветов и т.д. и т.п.UITableViewCell пользовательского IBOutlet соединение врежется
Когда я не делаю какие-либо соединений IBOutlet, я получаю чтобы увидеть пользовательскую ячейку, которую я создал, поэтому класс и ссылка хороши.
В тот момент я установить соединение с элементом, и скомпилировать я получаю:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<SearchViewController 0x1d05f0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key image.'
заголовочный файл ... снова, без связей это работает (но опять-таки я не могу изменить элементы, является вся идея пользовательской ячейки) Я получаю эту ошибку после подключения к IBOutlet ...
Я также попытался подключиться 1 на 1, но все они дают ошибку в том же диапазоне
CustomTableCell.h
#import <UIKit/UIKit.h>
@interface CustomTableCell : UITableViewCell
{
IBOutlet UIImageView *image;
IBOutlet UILabel *labelHeader;
IBOutlet UILabel *labelDescription;
IBOutlet UIButton *labelButtonPrice;
IBOutlet UIButton *labelButtonSize;
IBOutlet UIButton *labelButtonFloor;
IBOutlet UIButton *labelButtonBeds;
IBOutlet UIButton *labelButtonBaths;
}
@property (nonatomic) IBOutlet UIImageView *image;
@property (nonatomic) IBOutlet UILabel *labelHeader;
@property (nonatomic) IBOutlet UILabel *labelDescription;
@property (nonatomic) IBOutlet UIButton *labelButtonPrice;
@property (nonatomic) IBOutlet UIButton *labelButtonSize;
@property (nonatomic) IBOutlet UIButton *labelButtonFloor;
@property (nonatomic) IBOutlet UIButton *labelButtonBeds;
@property (nonatomic) IBOutlet UIButton *labelButtonBaths;
@end
CustomTableCell.m
#import "CustomTableCell.h"
@implementation CustomTableCell
@synthesize image;
@synthesize labelHeader;
@synthesize labelDescription;
@synthesize labelButtonPrice;
@synthesize labelButtonSize;
@synthesize labelButtonFloor;
@synthesize labelButtonBeds;
@synthesize labelButtonBaths;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
}
@end
TableView из таблицы поиска
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CustomTableCellIdentifier = @"CustomTableCell";
CustomTableCell *cell = (CustomTableCell *)[tableView dequeueReusableCellWithIdentifier:CustomTableCellIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCell_iPhone" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
//cell.nameLabel.text = [tableData objectAtIndex:indexPath.row];
//cell.thumbnailImageView.image = [UIImage imageNamed:[thumbnails objectAtIndex:indexPath.row]];
//cell.prepTimeLabel.text = [prepTime objectAtIndex:indexPath.row];
return cell;
}
Теперь, когда я делаю не connecitons вообще, я не получаю, чтобы увидеть пользовательские ячейки, , когда я сделать соединение прекращается.
Вы читали «причину» itgave? –
Если в редакторе IB/раскадровки вы щелкните правой кнопкой мыши по изображению 'UIImage', он показывает больше, чем одно выходное соединение? Если это так, удалите ненужные соединения. – bobnoble
Я не использую раскадровку, и я не удаляю ее нигде. – renevdkooi