Sunday, 15 July 2012

objective c - Detecting UIButton touches on a subview -



objective c - Detecting UIButton touches on a subview -

i have added subview contains uibutton control. subview added superview programatically. need perform action when button tapped, since it's contained within own subview, can't hook ibaction view controller in order force view controller.

is there easy way observe button tapped , phone call method within super view?

you can programmatically:

[buttonname addtarget:self action:@selector(methodname:) forcontrolevents:uicontroleventtouchupinside];

and create method:

- (void)methodname:(id)sender { // something. }

this have code.

objective-c uibutton subview ibaction

No comments:

Post a Comment