I want to call a method from another method.
Fox example, I want to call dismissActionSheet in buttonPressed.
How to do that?
- (void)dismissActionSheet
{
[menu dismissWithClickedButtonIndex:0 animated:YES];
}
- (IBAction)buttonPressed
{
categoryButton.hidden=TRUE;
categoryLabel.hidden=FALSE;
NSString *selected=[categoryData objectAtIndex:0];
categoryLabel.text=selected;
}
You can refer to the current object with the keyword self. To invoke dismissActionSheet simply call