tags:

views:

43

answers:

2

i want to write an event for the segment controller.By clicking First Tab i want to perform some calculation and by clicking Second Tab i want to perform some different operation.please help me.

+1  A: 

Create an IBAction

-(IBAction)segCtrlValueChanged:(UISegmentControl*)segCtrl;

and then link the "Value Changed" event to this action in Interface Builder, or programmatically, call

[segmentationControl addTarget:foo action:@selector(segCtrlValueChanged:)
              forControlEvents:UIControlEventValueChanged];

If the IBAction, check segCtrl.selectedSegmentIndex to see which item is active.

KennyTM
A: 

http://www.iphoneexamples.com/

Ankit Vyas