0

In my iPhone app,

I am working with XIB file.

There is a segmented control,

But there is no IBAction associate with any field,

Whenever I am selecting or touching an segment which method from my code will be called ?

Can I trace or see it in the xcode.

Actually I am looking through some complex code and could not catch the methods by breakpoints ....

Like this Question of stackoverflow.

How to print or see method call stack in xcode?

Community
  • 1
  • 1
Arpit B Parekh
  • 1,932
  • 5
  • 36
  • 57
  • Maybe this helps: [enter link description here][1] [1]: http://stackoverflow.com/questions/2056853/uisegmentedcontrol-delegate-touch-events – 0x90 Mar 05 '12 at 14:35

2 Answers2

1

If you want to see the target method you can right click the controller and see the the method associated with segmented control. If you want to add add some target method with segment controller then do this -

  1. Right click the controller
  2. drag the plus button of desired action(like valueChanged ) to .h file,one popup will come
  3. enter the action name click connect
  4. now go to .m file and write your logic in action
0

First of all, you do not associate any IBAction with the segmented control's "fields". You associate an IBAction with the control itself. So, to get you started:

  1. Create an IBAction like :

    -(IBAction)segmentChanged:(UISegmentedControl *)sender;
    
  2. Bind that action with the "Value Changed" event of your UISegmentedControl object

Now every time the segment changes, this method will be fired. To get the selected index use:

    uint selectedIndex = [sender selectedSegmentIndex];
Alladinian
  • 34,483
  • 6
  • 89
  • 91