如何在多个xib
子类中共享一个UITableViewCell
?
它们都具有相同的视图界面,所以我不想多次复制相同的xib
只是为了更改单元格类。
- (void)viewDidLoad
{
[super viewDidLoad];
[self.tableView registerNib:[UINib nibWithNibName:@"BaseCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"BaseCell"];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
BaseCell *baseCell = [tableView dequeueReusableCellWithIdentifier:@"BaseCell" forIndexPath:indexPath];
...
我需要的是我ChildCell
的一个实例 - 它是BaseCell
的子类。有什么想法吗?