我尝试在UITableView的自定义单元格中设置我的值。但是,当我开发它时,没有错误,但是我的价值没有设置在UILabel中!Iphone - 自定义单元格 - 无法设置UILabel
和想法?
自定义单元格:
@interface InscriptionCustomCell : UITableViewCell {
IBOutlet UILabel *titreCell;
IBOutlet UITextField *contenuCell;
}
查看我的UITableView:
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"InscriptionCustomCell";
InscriptionCustomCell *cell = (InscriptionCustomCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"InscriptionCustomCell" owner:self options:nil];
for (id currentObject in topLevelObjects){
if ([currentObject isKindOfClass:[UITableViewCell class]]){
cell = (InscriptionCustomCell *) currentObject;
break;
}
}
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if(indexPath.section == 0)
{
[cell.titreCell setText:[model.listModuleInfoPerso objectAtIndex:indexPath.row]];
[cell.contenuCell setPlaceholder:[model.listModuleInfoPerso objectAtIndex:indexPath.row]];
}else {
[cell.titreCell setText:[model.listModuleInfoSupp objectAtIndex:indexPath.row]];
[cell.contenuCell setPlaceholder:[model.listModuleInfoSupp objectAtIndex:indexPath.row]];
}
return cell;
}
为什么会有休息;? – 2011-05-16 17:04:25
确保标签在您的笔尖上连接到适当的插座 – 2011-05-16 17:24:29