启动页加载出来有延迟现象

启动页加载出来和tabbarcontroller比起来延缓了,这时要判断它是不是第一次启动,不是的话,就在另一个方法里面调用,不能放在同一个,否则就会有延迟,回调方法。


- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
// Override point for customization after application launch.


if (![[NSUserDefaults standardUserDefaults]boolForKey:@"firstStart"]) {
[[NSUserDefaults standardUserDefaults]setBool:YES forKey:@"firstStart"];


//NSLog(@"程序第一次启动");


guideViewController *guidview = [[guideViewController alloc]init];
guidview.buttonClickBlock= ^(UIButton*btn) {


JDTabBarController *jdtablebar = [[JDTabBarController alloc]init];
jdtablebar.delegate=self;
jdtablebar.selectedIndex=2;
self.window.rootViewController= jdtablebar;
[self.window makeKeyAndVisible];
};
self.window.rootViewController= guidview;


}else{
// NSLog(@"不是第一次启动");
//NSLog(@"程序不是第一次启动");
/*SCJumpViewController*jmpView=[[SCJumpViewController alloc]init];
jmpView.blockMainViewController = ^{
JDTabBarController *jdtablebar = [[JDTabBarController alloc]init];
jdtablebar.delegate = self;
jdtablebar.selectedIndex = 2;
self.window.rootViewController = jdtablebar;
[self.window makeKeyAndVisible];
};
self.window.rootViewController = jmpView; */


【启动页加载出来有延迟现象】SCJumpViewController *VC= [[SCJumpViewController alloc] init];
//__weak typeof(VC) weakSelf = VC;
VC.blockMainViewController = ^{
[VC.viewremoveFromSuperview];
};
UIWindow *window = [UIApplication sharedApplication].keyWindow;
[windowaddSubview:VC.view];
}

    推荐阅读