presentModalViewController and UINavigationController

今天遇到一个问题,直到现在还是有点不明白,看不懂,记录下来

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    [NSThread   sleepForTimeInterval:.1];                //设置启动时长
    
//    [[Global sharedGlobal] setupAtLaunching];
    [self.window addSubview:[Global sharedGlobal].mainViewController.view];        //注意这里添加的视图
    
    //  presentModalViewController
    UILoginViewController* loginViewController=[[UILoginViewController alloc] initFromNib];      
    [[Global sharedGlobal].mainViewController presentModalViewController:loginViewController 
                                                                animated:NO];
    
    navigationController = [[UINavigationController alloc] initWithRootViewController:loginViewController];
    navigationController.navigationBarHidden=YES;
    [self.window addSubview:navigationController.view];
    
    [loginViewController release];
    
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    return YES;
}


你可能感兴趣的:(application)