我想设置一个自定义单元格,所以我在故事板上创建了CustomDetailCell类和一个单元格,我创建了2个UILabel。对于标签,我更改字体和大小,并将自定义类与故事板上的单元格连接起来。我试着像这样使用它:
case DetailControllerAddressSection:
{
CustomDetailCell *customCell = (CustomDetailCell *)[tableView dequeueReusableCellWithIdentifier: @"AddressCell" forIndexPath: indexPath];
customCell.addresLabel.text = [self.objectData pointSubtitle];
customCell.distanceLabel.text = [self distanceMessageForObjectData: self.objectData];
return customCell;
break;
}
但在我的手机上只有一个标签与另一种字体(不像故事板单元格)
无法理解这个..有什么帮助?
PS单元格的标识符用于故事板。
编辑:自定义控制器
#import <UIKit/UIKit.h>
@interface CustomDetailCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *addressLabel;
@property (weak, nonatomic) IBOutlet UILabel *distanceLabel;
@end
#import "CustomDetailCell.h"
@implementation CustomDetailCell
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
}
@end