簡體   English   中英

在創建表視圖之前獲取 IndexPath.row 和 IndexPath.section

[英]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.rowIndexPath.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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM