I’ve already built the main app and the login.
In the appDelegate.m didFinishLaunchingWithOptions, I have
[self.window addSubview:rootController.view];
Which loads up the mainView.
However, I would want it to load up my login first as on a successful login, it will load the rootController (main app) etc.
When I put
[self.validateViewController presentModalViewController:validateViewController animated:YES];
and run the app, all I get is a white screen.
What am I doing wrong?
-> The reason I’m trying to do this is because at the moment, I have the rootController load up first but in the viewDidLoad, it loads the Login modal. Because of that, it runs numberOfRowsInSection first and so when I do eventually go into the app after login, it won’t show any tableview since it’s already gone through numberOfRowsInSection.
You need to run
presentModalViewControlleron a controller that has a view being displayed already. Right now you are runningpresentModalViewControlleron the view you actually want to present.You could present the validateViewController after adding the rootController to the app window: