LooN3y Posted June 13, 2012 Share Posted June 13, 2012 I'm trying to have a modal view controller that i call programmatically. heres my code: - (IBAction)searchView:(id)sender { GlobalStrings* theDataObject = [self theGlobalClass]; if (theDataObject.presentSearch == nil) { UIStoryboard *storyboard = [uIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"SearchBarViewController"]; [vc setModalPresentationStyle:UIModalPresentationFullScreen]; [self presentModalViewController:vc animated:YES]; } UIStoryboard *storyboard = [uIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"SearchBarViewController"]; [vc setModalPresentationStyle:UIModalPresentationFullScreen]; } i get a sigbart error, is it because the view controller I'm calling is a navigation controller? i also have a similar method in my "ViewWillAppear" for my log in screen. Link to comment Share on other sites More sharing options...
TH3L4UGH1NGM4N Posted June 13, 2012 Share Posted June 13, 2012 Is the view controller you're trying to call before the navigation controller a navigation controller as well? You could also segue to another storyboard by programatically setting up a segue to another view controller. Link to comment Share on other sites More sharing options...
LooN3y Posted June 13, 2012 Author Share Posted June 13, 2012 Is the view controller you're trying to call before the navigation controller a navigation controller as well? You could also segue to another storyboard by programatically setting up a segue to another view controller. no the login screen isn't a navigation controller. segue to another story board? Link to comment Share on other sites More sharing options...
TH3L4UGH1NGM4N Posted June 15, 2012 Share Posted June 15, 2012 Xcode might be iffy if you try to push a navigation controller on top of one that isn't already. Not to another storyboard just within that storyboard segue from that view controller to your navigation controller would be what I would do. You want me to elaborate a bit more on that or do you understand how to segue programatically? Link to comment Share on other sites More sharing options...
LooN3y Posted June 21, 2012 Author Share Posted June 21, 2012 Xcode might be iffy if you try to push a navigation controller on top of one that isn't already. Not to another storyboard just within that storyboard segue from that view controller to your navigation controller would be what I would do. You want me to elaborate a bit more on that or do you understand how to segue programatically? hmm for now, i just modally called the search view controller by button, just to get over the hump, i just want it to work first and foremost. thanks a lot though 1 Link to comment Share on other sites More sharing options...
Recommended Posts