Switch Back to Tab View
I'm making an application based on TabView Template. In the appdelegate, I've replaced the codes from applicationDidFinishLaunching method, I removed UITabView from it and replaced it with a new View. That view is actually a login screen which appears as soon as the app launches. Now, after successful login, I want the app to switch to UITabView. I tried these codes but they didn't work. :(
Nothing happens when user successfully logs in.
Here's the code I'm using:
NSArray * spanNodes = [bodyNode findChildTags:@"form"];
for (HTMLNode * spanNode in spanNodes) {
if ([[sp开发者_开发百科anNode getAttributeNamed:@"action"] isEqualToString:@"foo"]){
[self.authView.view removeFromSuperview];
[window addSubview:self.tabBarController.view];
[window bringSubviewToFront:self.tabBarController.view]; //Answer to second question
}
}
You don't need to remove the tab bar controller, it's far easier to just leave it in place and push the login screen to be on top of it, covering the tabs until login is successful, as described in an answer to a related question here: Adding login screen in front of Objective C Tab Bar Application for IOS
精彩评论