Swift獲取到AppDelegate

        // 拿到 AppDelegate
        
        let tempAppDelegate = UIApplication .sharedApplication().delegate;

        tempAppDelegate!.window!!.rootViewController = XNMainController();spa

        // 拿到 AppDelegate
        let tempAppDelegate = UIApplication .sharedApplication().delegate as!  AppDelegate;
it


OCio

    // 拿到 AppDelegate
    AppDelegate *tempAppDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    
    XNViewController *vc = [[XNViewController alloc]init];
    
    tempAppDelegate.window.rootViewController = vc;im

相關文章
相關標籤/搜索