이상한 일이 생겼습니다. 사용자 정의 tablecell을 만들려고했지만 initWithStyle이 호출되지 않았습니다.initWithStyle : (UITableViewCellStyle)이 호출되지 않았습니다.
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
내 테이블 셀은 정상 같습니다 내가 Customcell 펜촉로드하기 위해 노력하고있어 어떻게
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
NSLog(@"xx1111");
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *TFDCustomCell = @"TFDCell";
TFDCell *cell = (TFDCell *)[tableView dequeueReusableCellWithIdentifier:TFDCustomCell];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"TFDCell"
owner:self options:nil];
for (id oneObject in nib) if ([oneObject isKindOfClass:[TFDCell class]])
cell = (TFDCell *)oneObject;
}
return cell;
}
을하지만 NSLog(@"xx1111");
doenst 내 로그에 나타납니다. NSLog를 'setSelected'에 놓으면 '괜찮습니다.'
nib 파일에서 객체를 아카이브 해제 할 때 호출되는'initWithCoder'를 무시할 수도 있습니다. –
고마워, upvoted. – Nathan