私は、View Controller間でデータを送信するためにsegueの準備を使用しています。識別子が "ShowPost"の場合は最初の条件が働き、View ControllerにURLを送信します。しかし、識別子が "profileInfo"の場合、segueはデータを送信しません。segueが動作しないための準備の複数の条件
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "ShowPost" {
if let indexPath = tableView.indexPathForSelectedRow {
let _url = searchResults[indexPath.row]["link"].stringValue
let destinationController = segue.destinationViewController as! ShowPostViewController
destinationController.url = _url
}
else if segue.identifier == "ProfileInfo" {
if let indexPath = tableView.indexPathForSelectedRow {
let _userName = searchResults[indexPath.row]["owner"]["display_name"].stringValue
// print("name dc: \(destinationController.userName)")
let _userId = searchResults[indexPath.row]["owner"]["user_id"].stringValue
let _userReputation = searchResults[indexPath.row]["owner"]["reputation"].stringValue
let _ppImageString = searchResults[indexPath.row]["owner"]["profile_image"].stringValue
let destinationController = segue.destinationViewController as! ProfileInfoViewController
destinationController.userName = _userName
destinationController.userId = _userId
destinationController.userReputation = _userReputation
destinationController.ppImageString = _ppImageString
}
}
}
}
それが働いたおかげで、今では、内部のブレークポイントにヒットされていません。indexPath = tableView.indexPathForSelectedRow { せた場合_userName = searchResults [indexPath.row] ["owner"] ["display_name"]。文字列値 –
あなたが何を言おうとしていません。どこに打撃を与えないブレークポイントを置くのですか? – Lion
このコード行から_userName = searchResults [indexPath.row] ["owner"] ["display_name"]。stringValue if letブロックの終わりまで、つまりdestinationController.ppImageString = _ppImageString –