Reputation: 3581
My problem is like this
UITableView
cell class with xib file.UIViewController
having one UITableView
)UITableView
shows data in VC1. UITableView
of VC2. Hope I clear the situation.
Upvotes: 0
Views: 95
Reputation: 1300
Have you looked at - (void)registerNib:(UINib *)nib forCellReuseIdentifier:(NSString *)identifier
from the UITableView
class?
This method lets you register a cell from a seperate xib. You could register the same cell in multiple tableViews.
Example:
UINib *nib = [UINib nibWithName:@"CustomCell.xib" bundle:nil];
[self.tableView registerNib:nib forCellReuseIdentifier:@"CustomCell"];
Now you can use the custom cell in tableView:cellForRowAtIndexPath:
with the reuse identifier specified above.
Upvotes: 1
Reputation: 10834
You probably should define a view controller class that inherits from your ParentVC and from which VC1 and VC2 (and any other view controllers that will use the particular custom cell XIB) inherit, so that you can define the outlets and whatnot that you want to use in this new view controller class and use this new view controller class as the File's Owner in the XIB.
Upvotes: 0