- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
[self createTable]; // 出现显示问题, 放在 drawRect 中显示是正常的
}
return self;
}
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
}
-(void) createTable
{
mTable = [[UITableView alloc] initWithFrame:self.bounds style:UITableViewStylePlain];
mTable.dataSource = self;
mTable.delegate = self;
[self addSubview:mTable];
}