2015-10-15 45 views
-1

嗨我開發了一個照片共享應用程序就像Instagram在Xcode 6.3。我使用的是快速編程。雖然在Xcode7.0中創建的另一個項目中使用它的一些代碼,但我發現它有一些錯誤。爲什麼會發生這種情況?有人能幫我嗎?從Xcode 6.3切換到Xcode 7.0會導致一些錯誤嗎?

編輯

@IBAction func dashboardClick(sender: UIButton){ 

     let FaceLoginViewController = self.storyboard!.instantiateViewControllerWithIdentifier("dashboardoptions")as UIViewController 

     self.presentViewController(FaceLoginViewController, animated: false, completion: nil) 
    } 

我收到此錯誤信息:

Downcast from 'UIViewController?' to 'UIViewController?' only unwraps optionals; did you mean to use '!'?

+0

你正面臨哪些錯誤?請解釋(共享代碼片段將是一個加號)。 – pkc456

+0

我從UIViewController @ pkc456 – Anu

+1

http://castackoverflow.com/a/32974755/988169收到類似的錯誤UIViewControllers – pkc456

回答

2

之前ios9 instantiateViewControllerWithIdentifier回到AnyObject,現在它返回UIViewController,所以不需要投。

刪除演員,你很好去。

1

這是因爲Swift2不與斯威夫特向下兼容1.2/

+0

謝謝。請告訴我這是什麼解決方案? @Alexander Chernenko – Anu