I am trying to develop an application in which it allows users to login with AFNetworking. I have a database configured correctly, and everything seems to be working fine, except when the user first logs in.
I have a very simplified one:
[[API sharedInstance] commandWithParams:params onCompletion:^(NSDictionary *json) { //result returned NSDictionary* res = [[json objectForKey:@"result"] objectAtIndex:0]; if ([json objectForKey:@"error"]==nil && [[res objectForKey:@"UserID"] intValue]>0) { [[API sharedInstance] setUser: res]; [self performSegueWithIdentifier:@"Login" sender:self]; } else { //error [UIAlertView title:@"Error" withMessage:[json objectForKey:@"error"]]; } }];
Basically, the above code returns the result for user login data, only successfully if the login data matches. As you can see above, I clearly set the user to sharedInstance, which is used throughout the application. After the user is configured, I try to execute segue as the login button does.
Seg happens and the program works, but there are 2 problems that I canβt solve, and I spent hours trying to fix it. First, I get a message in the Xcode output window:
A warning. Try submitting a UITabBarController to LoginVC while the presentation continues!
And secondly, to check the correct installation of the user, on the "Profile" screen (on the first screen) there is a label on which the text is installed:
NSString stringWithFormat:@"Welcome %@",[[[API sharedInstance] user] objectForKey:@"username"]];
And this will hit or skip if the username appears or says (null), as shown:

You can also see the button I made there to print user values ββin the output window. Even when the message is "Welcome (null)" and I click the button, all the values ββare correct there, so I'm not sure why the string sometimes indicates null.
Here is the storyboard setting regarding the issue I am having:

If anyone could help me with this, I would really appreciate it.