[英]Ambiguous use of subscript using [indexPath.section][indexPath.row]
[英]get the IndexPath.row and IndexPath.section Before Creation of the table View
我想將特定的UITableViewCell
更新到 Swift IOS 中。
“ reloadRowsAtIndexPaths
”用於更新特定的UITableViewCell
,
self.tableView.reloadRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.None)
我關心的是在創建UITableView
之前“如何獲取IndexPath.row
和IndexPath.section
” ([indexPath]
本案例的([indexPath]
),我想通過兩者來更新特定的UItableViewCell
。
tableView.reloadRowsAtIndexPaths([NSIndexPath(forRow: 0, inSection: 0)], withRowAnimation: .None)
有了這個,你可以初始化一個 NSIndexPath 變量。 [] 括號,因為 reloadRowsAtIndexPath 需要一個數組作為參數。
我猜 NSIndexPath 初始值設定項中的參數非常簡單(forRow --> which row | inSection --> which section
高頻;)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.