0
我剛剛升級到Swift 3,並在UITableViewController中的以下代碼中獲取錯誤。Swift 3.參數標籤不匹配錯誤
代碼是從窗體返回segue,並且旨在刷新從表單插入新條目的表。這個工作罰款2.2,我已經改變了NSIndexPath到IndexPath
@IBAction func saveTripFormViewList(segue:UIStoryboardSegue){
trips = uiRealm.objects(Trip.self)
let indexPath = IndexPath(forRow: trips!.count - 1, inSection: 0)
tableView.insertRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic)
}
我得到的錯誤是
Argument labels '(forRow:, inSection:)' do not match any available overloads
如何解決錯誤
謝謝你。但是,如果將語法更改爲\t let indexPath = IndexPath(Row:trips.count - 1,Section:0)。我仍然收到關於不符合重載的列表的錯誤。 –
@MichaelMoulsdale沒有首都,只有小寫的行和部分 –