Custom UITableViewCell Not Using .xib (Most Likely Because of Flaw in init Method)

后端 未结 3 1550
温柔的废话
温柔的废话 2020-12-10 09:36

I subclassed the UITableViewCell in order to customize it, but I think I\'m missing something because: 1) It\'s not working and 2) There are a couple of things I\'m confused

3条回答
  •  醉梦人生
    2020-12-10 09:47

    You have to load the cell from the .xib instead:

    if ( cell == nil ) {
        cell = [[NSBundle mainBundle] loadNibNamed:@"CellXIBName" owner:nil options:nil][0];
    }
    
    // set the cell's properties
    

提交回复
热议问题