title: Xcode - Segue issues
body: <p>i've been trying to get a segue to work. I've written the following... but for some reason, the <code>...preparesegue...</code> method doesnt fire. I've read other related posts but i cant get it to fire, and just as importantly, the variable i'm need isnt transferred.</p>
  
  <p>m file:</p>
  
  <pre><code>@implementation CountryTableViewController
  
  
  -(void) getData:(NSData *) data {
      NSError *error;
      json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&amp;error];
      [self.tableView reloadData];
  }
  -(void) start {
      NSURL *url = [NSURL URLWithString: URL];
      NSData *data = [NSData dataWithContentsOfURL:url];
      [self getData:data];
  }
  
  - (void)viewDidLoad {
      [super viewDidLoad];
      [self start];
  }
  
  - (void)didReceiveMemoryWarning {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  #pragma mark - Table view data source
  
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
  
      // Return the number of sections.
      return 1;
  }
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  
      // Return the number of rows in the section.
      return [json count];
  }
  
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  
      static NSString *cellId = @"CellIdentifier";
  
      TableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
      if (!cell) {
          cell = [[TableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellId];
      }
      NSDictionary *info = [json objectAtIndex:indexPath.row];
  
      cell.TitleLabel.text = [info objectForKey:@"CountryName"];
      cell.ReferenceLabel.text = [info objectForKey:@"id"];
  
      return cell;
  }
  
  - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender tableView:(UITableView *)tableView {
      //if ([segue.identifier isEqualToString:@"CountryToState"]) {
      NSLog(@"TEST");
      NSIndexPath *path = [self.tableView indexPathForSelectedRow];
  
      TableViewCell *cell = (TableViewCell *)[tableView cellForRowAtIndexPath:path];
      NSString *countryRef = [[cell ReferenceLabel] text];
  
      TableViewControllerStates *TVCS = [segue destinationViewController];
      TVCS.receivedReferenceNumber = countryRef;
      //}
  }
  
  - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  
  
      //TableViewCell *cell = (TableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
      //NSString *countryRefNumber = [[cell ReferenceLabel] text];
      [self performSegueWithIdentifier:@"CountryToState" sender:tableView];
  
  }
  </code></pre>
  
  <p>h file</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #define URL @"http://localhost/Rs.php"
  
  @interface CountryTableViewController : UITableViewController &lt;UITableViewDelegate, UITableViewDataSource&gt; {
      NSMutableArray *json;
  }
  </code></pre>
  
  <p>Any help appreciated; thank you in advance.</p>
  
  <p><a href="https://i.stack.imgur.com/3f7eR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3f7eR.png" alt="enter image description here"></a></p>