所以,當我嘗試使用斯威夫特本()函數,它總是崩潰。這裏是我的代碼存在(_:動畫:完成:)不是斯威夫特3個工作
func infoOpener(sender: UISwipeGestureRecognizer) {
let location: CGPoint = sender.location(in: tableView)
let cellPath: IndexPath = tableView.indexPathForRow(at: location)!
let VC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "userInfo") as! userInfoVC
VC.username = "@\(self.user[cellPath.row].username)"
VC.imageUrl = self.user[cellPath.row].imagePath
self.present(VC, animated: false, completion: nil)
}
每當我使用present(_:animated:completion:)
功能,我得到一個EXC_BREAKPOINT錯誤。有人可以幫我嗎?
首先確保你的VC的那個對象已正確創建與否。我的意思是檢查對象'VC'是否爲零。 –
設置斷點自我的調用之前和檢查,如果你的VC是零 – Makaille
請檢查您所發送的數據是通過打印,適當和cellPath值正確與否,因爲代碼是正確的 –