に引数としてIビューコントローラからtextFieldShouldReturn
手動cellForRowAtindexPath
を呼び出しています、そしてcellForRowAtindexPath
の引数は、tableViewOutlet
とindexPath
(この例では「インデックス」)は、テーブルビューの出口を通過します。ここではcellForRowAtindexPath
とtableViewOutlet
は別のビューコントローラからのものですが、インスタンスを使用してそれらを呼び出しています。cellForRowAtindexPath
のようなエラーを示すそれを呼び出すcellForRowAtindexPath
回:あなたがここに呼んでいる何
unexpectedly found nil while unwrapping an optional value.
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
if(textField == carRating){
let rating = Float(textField.text!)
secondInstanceForMyData.masterCarData[index.row].carRating = rating
let _: MyTableViewCell = myViewControllerInstance.tableView(myViewControllerInstance.tableViewWillLoad as UITableView, cellForRowAt: index) as! MyTableViewCell
}
return true
}
「[致命的なエラー:予期せぬことにオプション値のアンラッピング中に予期せぬエラーが検出されました」とはどういう意味ですか?](https://stackoverflow.com/questions/32170456/what-does-fatal-error-unexpectedly-found- – the4kman
フェッチ中の変数にデータがないことを意味する – Harsha
'let _:MyTableViewCell = ...'で始まる行のポイントは何ですか? – rmaddy