在表中移动,删除 row,section
来源:互联网 发布:apache rewrite https 编辑:程序博客网 时间:2024/06/06 01:08
1。位置索引:base_index = 0
2。UITableView.h 针对表进行删除或移动 rows / sections操作
- (void)moveRowAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath //移动row
- (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection //移动section
NSIndexPath *indexPath = [NSIndexPath indexPathForRow : rowIndex inSection : sectionIndex];
- (void)deleteRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation //删除rows ,indexPaths : array Of indexPath
NSIndexSet *section = [NSIndexSet indexSetWithIndex: sectionIndex]; //indexSetWithIndexesInRange : 多个sections
- (void)deleteSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation //删除sections
3。更改与表相对应数据源里的数据,以下是对应的关于集合的使用
NSMutableArray *mutAry = [[NSMutableArray alloc] init] ; //普通初始化
NSMutableArray *mutAry = [[NSMutableArray alloc] initWithArray:@[@num1, @num2 , @num3 ] ] ; //用数值对象初始化
[mutAry indexOfObject : numberObject ] : >=0 / NSNotFound //对象在数组中的索引位置
[mutAry addObject : object ] ; //数组增加对象元素
NSMutableDictionary *mutDic = [[NSMutableDictionary alloc] initWithDictionary:@{ keyString : mutAry1 , keyString2 : mutAry2 } ] ;
mutDic.allKeys , mutDic[key] ; //获取
[mutDic removeObjectForKey : key ] ; //通过key删除
迭代执行:
__block NSUInteger keyIndex = 0; //在块中使用可更改的变量,声明要用__block
[mutDic enumerateKeysAndObjectsUsingBlock: ^(NSString *key, NSMutableArray *aryObj, BOOL *stop) {
[aryObj enumerateObjectsUsingBlock: ^(NSNumber *number, NSUInteger numberIndex, BOOL *stop) {
NSUInteger num = [number unsignedIntegerValue] ;
。。。。
}];
keyIndex++;
}];
- 在表中移动,删除 row,section
- 在PE中添加,删除SECTION
- 在PE中添加,删除SECTION
- uitableview中刷新单个section和row
- 在visual studio 2005 中制做 Gridview Row 移动变色
- 获取UItableView中button所在的section和row
- 在顺序表中插入和删除一个结点平均移动多少个结点
- 如何才能找回在可移动磁盘中删除的文件
- [NSIndexPath indexPathForRow:row inSection:section]在iPhone 5S 的iOS64位运行错误
- UITabelView GroupStyle 不同Section中自定义Cell For Row(xib模式)
- 在pe中加入一个section
- 在vmlinux中添加一个section
- UITableView刷新指定的row或者section
- [原创]删除Ini文件中Section下的某个Key
- 由PE中删除Section而牵出的内幕
- 滑动删除row
- table 添加删除row
- enable row movement 何时需要打开表的行移动
- Google的实时大规模流式处理系统MillWheel (水推磨轮转)
- 网页设计前端和数据流控制
- ORA-00600 内部错误代码, 参数 [kdsgrp1]
- MKMapView 添加图片
- 2013-12-11-window.returnvalue兼容性
- 在表中移动,删除 row,section
- 如何配置https访问tomcat
- 嵌入式 wget初学教程
- 【树】根据前序序列和中序序列写出二叉树
- 【分享】各种感情(喜怒哀乐)新浪微博情感200万条
- 2013-12-11用ChooseColor调用API的调色板
- 文件操作工具类
- 基于MINA框架快速开发网络应用程序(转)
- C# 创建一个文件夹快捷方式