I added a UIView
in the specified UITableViewCell
, then I added the two self-defined buttons on the UIView
. and the problem that showed up was that as I tap the button, it did not respond to the method.
Asked
Active
Viewed 168 times
0

Jerry Coffin
- 476,176
- 80
- 629
- 1,111

Peteryt
- 11
- 2
-
Show us how you added all these......... – DD_ Feb 04 '13 at 07:44
-
try this to add an action for your button and post the response http://stackoverflow.com/questions/5843427/how-do-you-add-an-action-to-a-button-programmatically-in-xcode – DD_ Feb 04 '13 at 07:46
1 Answers
3
Have you added a target for the touch up inside event (or whatever event you use) while you were creating the button?
[tempButton addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
- (void) buttonPressed:(UIButton *) sender
{
//Your implementation
}

guenis
- 2,520
- 2
- 25
- 37
-
Hey guenis,thanks for your answer, i did try this way, and use the Log method, while the result showed on the All Output area was only the Cell row index message, that means the pressed button method was not even invoked, it did really make me mad. – Peteryt Feb 05 '13 at 01:02
-