I have a button in my ProfileView view controller nib called that when pressed I went to display the OptionsView view controller.
In my ProfileView.m file I have this is viewDidLoad:
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Options" style:UIBarButtonItemStylePlain target:self action:@selector(actionOptions)];
and then I have:
- (void)actionOptions
{
OptionsView *screen = [[OptionsView alloc] initWithNibName:@"OptionsView" bundle:Nil];
[self.view addSubview:screen.view];
}
But whenever I tap the button I get a Thread 1: signal SIGABRT with the following console output:
2014-11-24 13:43:54.107 app[2161:5537921] didFailToRegisterForRemoteNotificationsWithError Error Domain=NSCocoaErrorDomain Code=3010 "remote notifications are not supported in the simulator" UserInfo=0x7ff7c2c365d0 {NSLocalizedDescription=remote notifications are not supported in the simulator}
2014-11-24 13:43:55.673 app[2161:5537921] *** Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /SourceCache/UIKit_Sim/UIKit-3318.16.14/UITableView.m:7344
2014-11-24 13:43:55.676 app[2161:5537921] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
You have SIGABRT because datasource of tableview that displayed in OptionsView is not returning valid cell from tableView:cellForRowAtIndexPath: method. Code that you are posted is OK.