views:

111

answers:

1

Ok I have a UIButton inside every row of a UITableView, and I want to fade it to alpha 0 when it begins editing. Then the opposite when it goes back to normal. How do I do this?

I know what methods to use but how do I access the buttons from outside tableViewcellForRowAtIndex:?

A: 

Well, actually, you can just call cellForRowAtIndexPath: pass in the index path that you get, and get the cell, then get the button inside of the cell and voila!

- (void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath {
   UITableViewCell *cell = [ tableView cellForRowAtIndexPath: indexPath ];
   UIButton *button = [ cell.contentView.subviews objectAtIndex: ... ];
   ...
}
Jacob Relkin
How do I access the button from that once I get the cell?
Jaba
@Jaba, it depends where you inserted your buttons into the cells. Can you post the code from `-cellForRowAtIndexPath`?
Jacob Relkin