title: Segmented Control not calling method
body: <p>I'm having trouble implementing a Segmented Control.  I believe I have everything hooked up, but the method is not being called when I click on either side of the Segmented Control.</p>
  
  <p>Header File</p>
  
  <pre><code>    #import &lt;UIKit/UIKit.h&gt;
  #import "ServiceConnector.h"
  #import &lt;MessageUI/MessageUI.h&gt;
  #import &lt;MessageUI/MFMessageComposeViewController.h&gt;
  #import &lt;AddressBook/AddressBook.h&gt;
  #import "Global.h"
  
  @interface ContactInfo : NSObject
  
  @property char group;
  @property (nonatomic, retain) NSString* firstName;
  @property (nonatomic, retain) NSString* lastName;
  @property (nonatomic, retain) NSString* phoneNumber;
  @property int isSelected;
  
  @end
  
  @interface Friends : UIViewController&lt;UITableViewDataSource, UITableViewDelegate, ServiceConnectorDelegate, MFMessageComposeViewControllerDelegate&gt;{
      UISegmentedControl *segmentedControl;
  }
  
  @property (nonatomic, retain) IBOutlet UITableView* tblFriends;
  @property (nonatomic, retain) IBOutlet UIButton* btnAdd;
  @property (nonatomic, retain) IBOutlet UIButton* btnInvite;
  @property (nonatomic, retain) IBOutlet UIButton* btnDone;
  
  @property (nonatomic, retain) NSMutableArray* contactList;
  @property (nonatomic, retain) NSMutableArray* contactGroup;
  @property (nonatomic, retain) NSMutableArray* friendList;
  @property (nonatomic, retain) NSString* modeStr;
  
  @property (nonatomic,retain) IBOutlet UISegmentedControl *segmentedControl;
  
  - (IBAction) InviteClicked;
  - (IBAction) AddClicked;
  - (IBAction) DoneClicked;
  - (IBAction)segmentSwitch;
  - (void) sendSMS:(NSString*) phoneNumber;
  - (void) sendInviteSMS:(NSMutableArray*) resipients;
  - (void) getContacts;
  - (void) groupFromContacts;
  - (void) groupFromFriends;
  
  // table delegates
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
  - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
  
  // service connector delegate
  - (void)requestReturnedData:(NSData*)data;
  
  //message delegate
  - (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result;
  
  @end
  </code></pre>
  
  <p>Simplified version of implementation (methods have been removed)</p>
  
  <pre><code>    #import "Friends.h"
  #import "JSONKit.h"
  
  @interface Friends ()
  
  @end
  
  @implementation ContactInfo
  
  @end
  
  @implementation Friends
  @synthesize segmentedControl;
  
  
  
  
  - (void)viewDidLoad
  {
      _friendList = [[NSMutableArray alloc] init];
      _contactList = [[NSMutableArray alloc] init];
      [self AddClicked];
      [super viewDidLoad];
      // Do any additional setup after loading the view from its nib.
  }
  
  - (void) dealloc
  {
      [segmentedControl release];
      [_friendList release];
      [_contactList release];
      [super dealloc];
  }
  
  - (IBAction)segmentSwitch {
      switch (self.segmentedControl.selectedSegmentIndex) {
          case 0:
              [self AddClicked];
              break;
          case 1:
              [self InviteClicked];
              break;
  
          default:
              break;
      }
  
  }
  
  @end
  </code></pre>
  
  <p>Here is connection inspector for the Segmented Control</p>
  
  <p><img src="https://i.stack.imgur.com/pmpsw.png" alt="Connection Inspector"></p>