Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 UITableView ,它有一个自定义标题,可以维护一些状态。当我调用 reloadData 来更改/更新 UITableView 中的数据时,标题也会重新加载。有什么方法可以防止这种行为以保持表头中的状态?
Don't put those states in the header. You've mixing the "view" with "model" in the MVC design.
Anyway, you could reload specific rows with -reloadRowsAtIndexPaths:withRowAnimation:.
-reloadRowsAtIndexPaths:withRowAnimation: