开发者

Subclassing UITableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {

    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];

    if (self) {     
        //My custom code for the view which I will add to the contentView
    }

    return self;
}

When I instantiate an object of this class and assign in the datasource - del开发者_如何学运维egate, then it is the same whatever "style" I am using right? (UITableViewCellStyleDefault etc.)


If you everything you need add in the contentView and you don't use textLabel, detailTextLabel ect. Than it is the same, yes. You could also pass your needed style in

self = [initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]; // The style is just an example...

So the given style from outside will be ignored. ;-)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜