编辑: 在解决这个问题时,我发现从您的UITabBarController
开始会更容易,然后通过您的AppDelegate.m
的didFinishLaunchingWithOptions:
方法执行登录验证。
问题: 这段代码位于我的AppDelegate.m
中的application didFinishLaunchingWithOptions:
方法中。
if([result isEqualToString: @"log"])
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *ivc = [storyboard instantiateViewControllerWithIdentifier:@"TabBarControl"];
[(UINavigationController*)self.window.rootViewController pushViewController:ivc animated:NO];
NSLog(@"It's hitting log");
}
只需对HTTP响应进行处理以确定用户是否已登录,并将其传递给我的TabBarController即可。问题在于它使用了push而不是modal转换来显示页面。由于presentModalViewController方法在iOS7中已被弃用或删除,我该如何编写程序以强制执行模态呈现?