【发布时间】:2015-02-07 09:07:39
【问题描述】:
由于某种原因,当到达 performSegueWithIdentifier 行时,我收到此错误。
我有这个代码:
if let storedAPIKeychain: AnyObject = dictionary.objectForKey("api_key") {
println(storedAPIKeychain)
//This is the line that causes the problems.
performSegueWithIdentifier("skipBrandSegue", sender: self)
}
println() 工作正常并输出正确的信息。
我正在尝试将 storedAPIKeychain 与 segue 一起传递:
override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {
if segue.identifier == "skipBrandSegue" {
// Create a new variable to store the instance of the next view controller
let destinationVC = segue.destinationViewController as brandsViewController
destinationVC.storedAPIKey = storedAPIKeychain!
}
}
我认为这可能是问题所在。但是,当我将该行更改为:
destinationVC.storedAPIKey = "someAPIplaceholder"
我也遇到同样的错误。
谁能告诉我这个错误是什么以及如何解决它。谢谢。
编辑:错误截图:
【问题讨论】: