Detecting when a cell's detail-disclosure button has been clicked (when using a custom cell XIB)

Posted by Gloria on Stack Overflow See other posts from Stack Overflow or by Gloria
Published on 2010-04-22T04:01:23Z Indexed on 2010/04/22 4:03 UTC
Read the original article Hit count: 215

1 if (cell == nil) 
2 {
3    [[NSBundle mainBundle] loadNibNamed:@"TVCell" owner:self options:nil];
4    cell = tvCell;
5    self.tvCell = nil;
6  }

There's some code from an Apple example of using your own "custom cell XIB" to create cells in a UITableView.

It appears to work... but I think I would do better to actually UNDERSTAND what is being done there.

Why isn't line #3 assigning the value TO something?

cell = [[NSBundle mainBundle] loadNibNamed:@"TVCell" owner:self options:nil];

(In fact, cell and tvCell aren't being used at all.)

Why is line #4 assigning using tvCell when nothing has been put it in at all, yet?

Why is line #5 nulling out the tvCell that I need?

Why is "@property (nonatomic, assign) IBOutlet UITableViewCell *tvCell;" using assign, not retain?

About the only thing I can't get working correctly is when I put a disclosure-button on my custom cell XIB. Is there a way for me to detect when the user has clicked on it? (Hopefully, without using 100s of TAGs.)

© Stack Overflow or respective owner

Related posts about uitableviewcell

Related posts about uitableview