¡@

Home 

2014/10/15 ¤U¤È 10:04:46

iphone Programming Glossary: buttonpressedaction

Pass an argument to selector

http://stackoverflow.com/questions/12297511/pass-an-argument-to-selector

@ Cell self configureCell cell atIndexPath indexPath return cell ... button addTarget self action @selector buttonPressedAction forControlEvents UIControlEventTouchUpInside void buttonPressedAction UIButton button int row indexPath.row NSLog @ ROW.. ... button addTarget self action @selector buttonPressedAction forControlEvents UIControlEventTouchUpInside void buttonPressedAction UIButton button int row indexPath.row NSLog @ ROW i row How do I pass the indexPath as argument to my selector iphone objective..

Detecting which UIButton was pressed in a UITableView

http://stackoverflow.com/questions/1802707/detecting-which-uibutton-was-pressed-in-a-uitableview

autorelelase UIButton button UIButton alloc initWithFrame CGRectMake 10 5 40 20 button addTarget self action @selector buttonPressedAction forControlEvents UIControlEventTouchUpInside button setTag 1 cell.contentView addSubview button button release UIButton.. cell viewWithTag 1 button setTitle @ Edit forState UIControlStateNormal return cell My question is this in the buttonPressedAction method how do I know which button has been pressed. I've considered using tags but I'm not sure this is the best route... tags but I'm not sure this is the best route. I'd like to be able to somehow tag the indexPath onto the control. void buttonPressedAction id sender UIButton button UIButton sender how do I know which button sent this message processing button press for this..