I am creating an iOS app as defined here! So here in this app I am using a segmented control (Dynamically added) to give the user the choice to select one of the options. When the user selects a choice I want to send a string to selector method, so I wanted to know if we can send anything apart from id and event to an action:@selector that we add.
Here's the code
NSArray *optionsArray =[NSArray arrayWithArray:qna2.answers];
UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:optionsArray];
segmentedControl.frame = CGRectMake(xOffset,yOffset, 250, 50);
[segmentedControl setSelectedSegmentIndex:UISegmentedControlNoSegment];
[self.view addSubview:segmentedControl];
yOffset+=100;
[segmentedControl addTarget:self action:@selector(MyAction:) forControlEvents: UIControlEventValueChanged];
So can we do like @selector(Myaction: Category) ?