0
で使用することはできません。どれでも私はWatchKitのコンテキストでセグエを使用しようとしていた、と私は、この問題に遭遇した辞書リテラル
コンテクストタイプ「[任意]は、」辞書リテラル
で使用することはできませんここで
は、私が使っていたコードです。
override func contextsForSegue(withIdentifier segueIdentifier: String) -> [Any]? {
if segueIdentifier == "One" {
return ["sceneName" : "One"]
} else if segueIdentifier == "Two" {
return ["sceneName": "Two"]
} else {
return ["sceneName": "Three"]
}
}
セグエ先には何のエラーを生成しない、このコードは、あります:
@IBOutlet var theName: WKInterfaceLabel!
override func awake(withContext context: Any?) {
super.awake(withContext: context)
// Configure interface objects here.
self.setTitle("")
let dict = context as? NSDictionary
if dict != nil {
let segueContext = dict![["sceneName"]] as! String
theName.setText(segueContext)
}
}
誰かが助けてくれることを願っています!