2015-12-30 63 views
0

我有這樣的警告,我不明白的地方是我使用的代碼7.2和iOS 9.2誰的觀點是不是在窗口層次的Facebook登錄

錯誤我的代碼

錯誤:

warning: Attempt to present < VidcustCustomAppIos.VCTabBarController: 0x7ff838f50790 > on < FBSDKContainerViewController: 0x7ff838d8ceb0 > whose view is not in the window hierarchy!

@IBAction func facebookLoginDidTouch(sender: AnyObject) { 
    let loginManager = FBSDKLoginManager() 
    loginManager.logInWithReadPermissions(["public_profile", "email"], fromViewController: self) { (result:FBSDKLoginManagerLoginResult!, error:NSError!) -> Void in 
     if (result.isCancelled) { 
      print("Cancelled") 
     } else { 
      print("Logged in") 
      let token = FBSDKAccessToken.currentAccessToken() 
      VCClusterManager.sharedInstance.connectWithFacebook(token.tokenString, completion: { (isConnected, error) ->() in 
       if error == nil && isConnected == true { 
        self.performSegueWithIdentifier(self.segueIdentifier, sender: nil) 
       } 
      }) 
     } 
    } 
} 

回答

0

這不符合的情況下,Facebook的登錄

爲執行時,您將收到此警告來自嵌入容器中的視圖控制器。解決方案是使用來自容器父級的segue,而不是來自容器的視圖控制器。

+0

Madhava \t 「嵌入容器中的視圖控制器」是什麼意思。當你說嵌入到一個容器中時,你到底意味着什麼?你指的是什麼? – breaktop

0

錯誤:從嵌入在容器的視圖控制器執行時賽格瑞 開發者可以接收此警告。

解決方案:從容器的父 使用SEGUE,而不是從容器的視圖控制器(例如後退按鈕,一個按鈕或要執行一個動作過渡到另一個視圖控制器的任何按鈕。)

相關問題