title: segue.identifier isEqualToString:@"segue1" is always null. IOS 6.1 storyboard
body: <p>I can't figure out why my segue.identifier is always returning null.  I set the segue identifiers in the storboard.  </p>
  
  <p>ViewController1</p>
  
  <pre><code>-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
  {
       NSLog(@"prepared %@",segue.identifier);
       if([[segue identifier] isEqualToString:@"segue1"] ){
       NSLog(@"segue is equal to 1");
       }
   }
  </code></pre>
  
  <p>ViewController2</p>
  
  <pre><code>- (IBAction)unwindFromSegue:(UIStoryboardSegue *)segue {
  
      NSLog(@"unwinded %@",segue.identifier);
  }
  </code></pre>
  
  <p>The log message is always null so if statement is never true.  Any thoughts why i cant get the identifier?</p>
  
  <p>EDIT:</p>
  
  <p>I made a whole new project for testing.  It's a single view application with ViewController and SecondViewController.  In the storyboard I made a popover segue connection from a button in View Controller to SecondViewController and set the segue identifier to segue1.  </p>
  
  <p>On SecondViewController I made a back button and connected it to the unwindFromSegue in my ViewController.  I also added prepareForSegue in the SecondViewController.</p>
  
  <p>ViewController.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface ViewController : UIViewController
  
  @end
  </code></pre>
  
  <p>ViewController.m</p>
  
  <pre><code>#import "ViewController.h"
  
  @interface ViewController ()
  
  @end
  
  @implementation ViewController
  
  - (void)viewDidLoad
  {
  [super viewDidLoad];
  // Do any additional setup after loading the view, typically from a nib.
  }
  
  - (void)didReceiveMemoryWarning
  {
  [super didReceiveMemoryWarning];
  // Dispose of any resources that can be recreated.
  }
  - (IBAction)unwindFromSegue:(UIStoryboardSegue *)segue {
  NSLog(@"unwinded %@",segue.identifier);
  }
  @end
  </code></pre>
  
  <p>SecondViewController.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface SecondViewController : UIViewController
  
  @end
  </code></pre>
  
  <p>SecondViewController.m</p>
  
  <pre><code>#import "SecondViewController.h"
  
  @interface SecondViewController ()
  
  @end
  
  @implementation SecondViewController
  
  - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)
   nibBundleOrNil
  {
  self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
  if (self) {
      // Custom initialization
  }
  return self;
  }
  
  - (void)viewDidLoad
  {
  [super viewDidLoad];
  // Do any additional setup after loading the view.
  }
  
  - (void)didReceiveMemoryWarning
  {
  [super didReceiveMemoryWarning];
  // Dispose of any resources that can be recreated.
  }
  //was just testing unwindFromSegue here. Didn't mean to post here, 
  //but I will keep it in with an answer referring to it
  //- (IBAction)unwindFromSegue:(UIStoryboardSegue *)segue{
  //NSLog(@"unwind in second %@",segue.identifier);
  //}
  
  
  - (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
  NSLog(@"prepare %@",segue.identifier);
  
  }
  
  @end
  </code></pre>
  
  <p>Hope this helps.  Thanks</p>