Alex Zavatone Alex Zavatone - 5 months ago 31
Objective-C Question

registerNib for a UITableViewCell in an XIB with multiple views

I've successfully been able to use registerNib to define a UITableViewCell's UI within an XIB that only has one UITableViewCell prototype within it.

In the interest of encapsulation, would it be possible to have an XIB with more than one UITableViewCell in it and still be able to load the proper cell using registerNib?

If so, how would one identify the desired cell prototype within the XIB in code?

I'm currently doing this in the tableView's VDL which works fine:

[self.tableView registerNib:[UINib nibWithNibName:@"LogoCell" bundle:[NSBundle mainBundle]]
forCellReuseIdentifier:CellId];


Is there a way to specify which cell prototype within the XIB we want to use?

Thanks in advance.

Answer
In the interest of encapsulation, would it be possible to have an XIB with more than one UITableViewCell in it and still be able to load the proper cell using registerNib?

No.