title: NSBundle mainBundle gives sigabrt error?
body: <p>I am using xCode 4.2 to build an iPhone app.</p>
  
  <p><strong>Related Question</strong>  - I think this might be the REAL problem I'm experiencing:
  <a href="https://stackoverflow.com/questions/10759153/why-does-tableview-dequeuereusablecellwithidentifiercellidentifier-return-null">Why does tableView dequeueReusableCellWithIdentifier:CellIdentifier return null?</a></p>
  
  <p>But let me continue with this quesiton anyway:</p>
  
  <p>There's something about the line <code>[[NSBundle mainBundle] loadNibNamed:@"WSCSessionCell" owner:nil options:nil];</code> that gives me a SIGABRT error when I set up the rootviewcontroller in a certain way and not another way.  Let me start with sample code from my WSCSessionTable which inherits UITableViewController:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *CellIdentifier = @"WSCSessionCell";
  
      WSCSessionCell *cell = (WSCSessionCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  
      if (cell == nil) {
  
          NSArray * topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"WSCSessionCell" owner:nil options:nil];
  
          for(id currentObject in topLevelObjects)
          {
              if([currentObject isKindOfClass:[UITableView class]])
              {
                  cell = (WSCSessionCell *) currentObject;
                  break;
              }
          }
  
      }
  return cell;
  }
  </code></pre>
  
  <p><strong>Scenario 1 - No Problem - No SIGABRT</strong></p>
  
  <p>The code above works fine when my NavigationController rootviewcontrols WSCSessionTable.  Here's what my storyboard looks like for reference.
  <img src="https://i.stack.imgur.com/qZURK.png" alt="Navigation Controller to WSCSessionTable"></p>
  
  <p><strong>Scenario 2 - Problems, Code causes SIGABRT</strong></p>
  
  <p>The above code causes a SIGABRT error when I put a UIViewController between the navigation controller and WSCSessionTable.  I then use a button to instantiate WSCSessionTable.  here's my story board set up</p>
  
  <p><img src="https://i.stack.imgur.com/TwNWu.png" alt="Activate WSCSession via button tap"></p>
  
  <p>This is the event handler for the button</p>
  
  <pre><code>- (IBAction)goToSession:(id)sender
  {
      wscAppDelegate *appDelegate = (wscAppDelegate *)[[UIApplication sharedApplication] delegate];
      UIStoryboard * storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:[NSBundle mainBundle]];
      wscSessions *childView = [storyboard instantiateViewControllerWithIdentifier:@"sessionstable"];
  //    wscSessions *childView = [storyboard instantiateViewControllerWithIdentifier:@"sessionstable"];
      childView._arrData = appDelegate._arrSession;
      childView._arrSpeaker = appDelegate._arrSpeaker;
      childView.title = @"SEssions";
      [self.navigationController pushViewController:childView animated:YES]; 
      }
  </code></pre>
  
  <p>I get a sigabrt error in in the cellforrowatindexpath function on the line with the nsbundle mainbundle.  Here's the error output</p>
  
  <pre><code>*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle &lt;/Users/dduvernet/Library/Application Support/iPhone Simulator/5.1/Applications/54EF04FD-E010-48BB-A0F4-EB0F12BF8D6A/gmmiphone.app&gt; (loaded)' with name 'WSCSessionCell''
  *** First throw call stack:
  (0x1da1022 0x2359cd6 0x1d49a48 0x1d499b9 0xa98638 0xa99eb7 0x3d9f 0x911c54 0x9123ce 0x8fdcbd 0x90c6f1 0x8b5d21 0x1da2e42 0x181679 0x18b579 0x1104f7 0x1123f6 0x111ad0 0x1d7599e 0x1d0c640 0x1cd84c6 0x1cd7d84 0x1cd7c9b 0x28f07d8 0x28f088a 0x877626 0x2138 0x2095 0x1)
  terminate called throwing an exception(gdb) 
  </code></pre>
  
  <p>
  Does anyone know how I can instantiate WSCSessiontable via button tab down?</p>
  
  <p><strong>Related Question</strong>  - I think this might be the REAL problem I'm experiencing:
  <a href="https://stackoverflow.com/questions/10759153/why-does-tableview-dequeuereusablecellwithidentifiercellidentifier-return-null">Why does tableView dequeueReusableCellWithIdentifier:CellIdentifier return null?</a></p>