Reputation: 1896
Returning to iOS development after a year break, and its all mayhem.
When executing the 3 lines of code below, i see the screenshot of the emulator below.
I've also attempted to add the LoginForm view controller as the root view controller, as it should, except i also see a blank screen.
As shown in the screenshot of xcode, the naming all matches up. All the constraints are also blue.
I've included a NSLog in the viewDidLoad of the LoginForm, that i have seen log at points, but still nothing is displayed.
What am i missing, or doing wrong? I've got nothing from errors to work with.
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *view = [storyboard instantiateViewControllerWithIdentifier:@"LoginForm"];
[self.navigationController pushViewController:view animated:YES ];
Upvotes: 1
Views: 705
Reputation: 159
Try using
[self presentViewController:myVC animated:NO completion:nil];
Because your storyboard doesn't seem to be using navigation contoller.
Upvotes: 2
Reputation: 1874
If you Have Xib File
Viewcontroller1 *viewController = [[Viewcontroller1 alloc]
initWithNibName:@"Viewcontroller1" bundle:nil];
[[self navigationController] pushViewController:viewController animated:YES];
if you have Storyboard
Viewcontroller1*vc=[self.storyboard instantiateViewControllerWithIdentifier:@"Viewcontroller1"];
[self.navigationController pushViewController:vc animated:YES];
Upvotes: 0