UITableView刷新问题
2015-07-14 13:12
381 查看
UITableView刷新分为整体刷新和局部刷新,必须先修改数据,然后再刷新。
1)整体刷新:
// 先修改模型数据
NSString *text = [alertView textFieldAtIndex:0].text;
shop *shop = _shops[row];
shop.desc = text;
// 再刷新整个表格(所有数据都变动)
[_tableView reloadData];
2)局部刷新(个别数据有变动)
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:0];
NSArray *paths = @[indexPath];
[_tableView reloadRowsAtIndexPaths:paths withRowAnimation:UITableViewRowAnimationBottom];
1)整体刷新:
// 先修改模型数据
NSString *text = [alertView textFieldAtIndex:0].text;
shop *shop = _shops[row];
shop.desc = text;
// 再刷新整个表格(所有数据都变动)
[_tableView reloadData];
2)局部刷新(个别数据有变动)
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:0];
NSArray *paths = @[indexPath];
[_tableView reloadRowsAtIndexPaths:paths withRowAnimation:UITableViewRowAnimationBottom];
相关文章推荐
- UISliderControl学习记录
- MI卡UID
- 关于UGUI挡道3D的物体触发点击事件无法和3D物体分离的解决方案
- ios UIKit动力
- ios UIKit动力 分类: ios技术 2015-07-14 12:55 196人阅读 评论(0) 收藏
- IOS开发点滴---UIView转UIImage以及切割UIView
- xcode6模拟器UITextField不能自动弹出键盘
- OSGI Blueprint(2)
- NDK编译问题: Program "ndk-build" is not found in PATH 和 Unable to launch cygpath. Is Cygwin on the path?
- Win10 UWP开发中的重复性静态UI绘制小技巧 2
- HDU 5273 Dylans loves sequence(线段树求逆序数对+离散化)
- UITableViewcell autolayout下动态高度
- 判断UITextField.text是否为空
- Introduction to Guid ( globally unique identifier )
- 嵌套循环中的 continue ,break
- OSGI Blueprint
- leetcode Repeated DNA Sequences 哈希表
- [SoapUI] 在某个测试步骤下面增加Script Assertion,运用 messageExchange 获取response content
- Functional MRI (second edition) -- 5. MR Contrast Mechanisms and Pulse Sequences
- easyui在ie下要注意的问题