
Untitled
By: a guest on
Apr 24th, 2012 | syntax:
None | size: 0.57 KB | hits: 19 | expires: Never
Table view cell as button
-(IBAction)buttonPressed{
//Do my stuff
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
//check if your cell is pressed
BOOL myCellIsPressed = ...
if(myCellIsPressed)
[self buttonPressed];
}
int myCellRow = 5;
if (myCellRow == IndexPath.row) //YES!
#define myTag 5
UITableViewCell *myCell = ...
myCell.tag = myTag
UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath];
if (selectedCell.tag == myTag) //YES!
tableview : didselectRow