KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
So i've been looking at using UITableView's registerNib: and [dequeueReusableCellWithIdentifier: forIndexPath:] for loading up a custom UITableCellView from a NIB . Here are the important bits from my controller: - (void)viewDidLoad [super viewDidLoad]; self.tableView.bounces = NO; [self.tableView registerNib:[UINib nibWithNibName:@"ProgramListViewCell" bundle:nil] forCellReuseIdentifier:@"Cell"]; - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath TVProgramListTableViewCell *cell = (TVProgramListTableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; cell.frame = CGRectMake(0, 0, CELLWIDTH, OPENCELLHEIGHT); cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.clipsToBounds = YES; cell.titleLabel.text = [NSString stringWithFormat:@"herpa derp: %i", indexPath.row]; return cell; So i'm registering the NIB when the view loads and then utilizing it for cell dequeuing. Up to this point everything is working like i expect it to. My custom TVProgramListTableViewCell is being properly loaded from the NIB and it's IBOutlet is being wired up. The NIB contains a view with a button in it that i would like to have fire events to the controller. I can set the File's Owner type as my Table View Controller class but i do not know how to actually wire up the File's Owner. Now if i was using loadNibNamed: , and loading the NIB myself, wiring up the File's Owner would be easy. Is there any way to achieve this while utilizing registerNib ? Other than not being able to wire up the File's Owner this seems like the perfect way of using custom cells in a UITableView .
Tags (comma-separated)
Save Edits
Cancel