I am building my app which is asking the user to authenticate. In case the session with the server is expired it pops the login controller. So far so good. The problem is that when the user is opening the app and the first screen (empty table view) is showed then the login screen. I know it's a detail but I think it's not right.
This is my MainViewController which is under Navigation Controller. Code:
-(void)viewDidAppear:(BOOL)animated{
NSLog(@"Username: %@",[MMCurrentUser email]);
//Check if the user is logged and shows the sites else it shows the login screen
if(![MMCurrentUser email]){
LoginLaunch *ll;
ll= [[LoginLaunch alloc]initLoginScreenFrom:self];
}}
If I put that code in willAppear I get the warning: "Presenting view controllers on detached view controllers is discouraged." and the problem still exist.
Anyone knows a good way to solve this problem?
-presentViewController:animated:completion:withanimated == NO(immediately) first thing inside-viewDidAppear? Does your underlying view controller show for some frames, or is it successfully hidden? - Nicolas Miari