Alex Rivera | Logout

Add target for UIButton - iOS

Asked 2012-08-13T18:03:37.877
14

Anyoone can help me on how to add action to call the following method using UIButton.

-(void)navigatePics:(id)sender andIndex:(NSInteger *)index{}
Edit
Report

1 Answer

0

This should do the trick. Don't use self if you want to call this method on another instance. In that case, just use that instance in place of self.

[button addTarget:self action:@selector(navigatePics:andIndex:) forControlEvents:UIControlEventTouchUpInside];
answered 2012-08-13T18:08:56.700

Your Answer