title: Why is my Segmented control not reacting?
body: <p>I am working with an iPhone application in Xcode and I want to use a segmented control with 4 different choices. </p>
  
  <p>I am wondering what I am doing wrong and why the NSLog messages don't show when I click on it?</p>
  
  <p>This is my code:</p>
  
  <p>.h file:</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  
  @interface Format : UIViewController{
  
      IBOutlet UISegmentedControl *papper;
  }
  
  @property (nonatomic, retain) IBOutlet UISegmentedControl *papper;
  
  -(IBAction)papperskontrollSwitched:(id)sender;
  </code></pre>
  
  <p>.m file:</p>
  
  <pre><code>#import "Format.h"
  
  @implementation Format
  
  @synthesize papper;
  
  -(IBAction)papperskontrollSwitched:(id)sender{
      if(papper.selectedSegmentIndex==0){
  
          NSLog(@"A5 valdes");
      } 
  
      else if(papper.selectedSegmentIndex==1){
  
          NSLog(@"A4 valdes");
      }
  
      else if(papper.selectedSegmentIndex==2){
  
          NSLog(@"A3 valdes");
      }
  
      else if(papper.selectedSegmentIndex==3){
  
          NSLog(@"Visitkort valdes");
      }
  }
  
  @end
  </code></pre>