Я создал пользовательскую таблицу для самой простой. Я сделал контроллер панели.Невидимый текст ярлыка в UITableView
FoglalasTableViewCell.h
@interface FoglalasTableViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *datumLabelFoglalas;
@property (weak, nonatomic) IBOutlet UILabel *adminNevekLabelFoglalas;
@end
FoglalasTableViewCell.m
#import "FoglalasTableViewCell.h"
@implementation FoglalasTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
}
return self;
}
- (void)awakeFromNib
{
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdent = @"foglalas";
FoglalasTableViewCell *Cellw = [tableView dequeueReusableCellWithIdentifier:CellIdent];
if (!Cellw) {
Cellw = [[FoglalasTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdent];
// Cellw = [[FoglalasTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdent];
}
if (Cellw.backgroundView == nil) {
if ([foglaltArr[indexPath.row] isEqual: @0]) {
[Cellw setBackgroundColor:[UIColor greenColor]];
} else if ([foglaltArr[indexPath.row] isEqual: @1]) {
[Cellw setBackgroundColor:[UIColor redColor]];
}
}
NSLog(@"%d. foglaltArr : %@",indexPath.row, [foglaltArr objectAtIndex:indexPath.row]);
NSLog(@"%d orakArr %@",indexPath.row,orakArr[indexPath.row]);
Cellw.datumLabelFoglalas.text = [foglaltArr objectAtIndex:indexPath.row];
Cellw.adminNevekLabelFoglalas.text = @"blah..";
return Cellw;
}
Я подключен источник данных. Он изменил цвет фона ячеек. Но эти метки не получают источники данных. Я не понимаю, зачем получить исходный фон, и метки почему бы не получить !? Я не знаю, как его решить. Пожалуйста, помогите мне.
! [Источник виден фон] [1]
Спасибо учебник, но не решить мои проблемы, пожалуйста, смотрите мою ошибку log: Завершение приложения из-за неперехваченного исключения «NSInternalInconsistencyException», причина: «Не удалось загрузить NIB в пакете:« NSBundle private/var/mobile/Containers/Bundle/Application/CEB07188-72C4-4A3A-BCE0-14709418D5EE/BBQ .app> (загружен) 'с именем' FoglalasTableViewCell '' Я использую раскадровку. – bolo
Вы используете раскадровку, и, возможно, вы создаете ячейку в раскадровке, которая называется прототипом. –
Я отредактировал свой ответ, пожалуйста, следуйте этому. –