 <p>I think the method should look like this </p> <pre><code>- (IBAction)ChangeSeg:(UISegmentedControl *)sender { if(sender.selectedSegmentIndex == 0){ UpperLower=0; } else if(sender.selectedSegmentIndex == 1){ UpperLower=1; } } </code></pre> <p>The sender will have the selectedSegmentIndex that was chosen.</p>