2014资料整理--NSArray用法(四)
来源:互联网 发布:淘宝sc面膜是正品吗 编辑:程序博客网 时间:2024/06/07 04:53
1、获取指定区域对象,容易内存泄露
- (void)getObjects:(id__unsafe_unretained [])objects;
2、 向数组中添加一个对象
- (void)addObject:(id)anObject;3、向数组中指定的index 位置,插入一个新的对象
- (void)insertObject:(id)anObject atIndex:(NSUInteger)index;
4、移除数组的最后一个元素
- (void)removeLastObject;
5、移除指定为指定位置的元素
- (void)removeObjectAtIndex:(NSUInteger)index;
6、使用anObject 替换 下标为 index 位置上的元素
- (void)replaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject;
7、使用一个数组给当前的数组添加元素
- (void)addObjectsFromArray:(NSArray *)otherArray;
8、交换指定 index1 和 index2 两个位置上的元素
- (void)exchangeObjectAtIndex:(NSUInteger)idx1 withObjectAtIndex:(NSUInteger)idx2;
9、 移除数组中的所有元素,销毁数组
- (void)removeAllObjects;
10、使用anObject 对象替换 range 位置上的元素,
相当于删除 range位置的元素,然后在把 anobject 插入到这个位置
- (void)removeObject:(id)anObject inRange:(NSRange)range;
11、如果指定的元素,如果元素不存在,则不移除
- (void)removeObject:(id)anObject;
12、 同9 相同,移除指定区域指定对象
- (void)removeObjectIdenticalTo:(id)anObject inRange:(NSRange)range;
13、方法内容 和9 相同
- (void)removeObjectIdenticalTo:(id)anObject;
14、不建议使用,移除指定索引之间的对象
- (void)removeObjectsFromIndices:(NSUInteger *)indices numIndices:(NSUInteger)cnt NS_DEPRECATED(10_0, 10_6, 2_0, 4_0);
15、移除给定数组中的元素
- (void)removeObjectsInArray:(NSArray *)otherArray;
16、移除指定range 上的所有元素
- (void)removeObjectsInRange:(NSRange)range;
17、使用otherArray 数组中 otherRange 位置上的元素,替换当前数组中 range 位置上的元素。(移除(数组A指定区域)包含的(指定数组B的指定区域)的元素)
- (void)replaceObjectsInRange:(NSRange)range withObjectsFromArray:(NSArray *)otherArray range:(NSRange)otherRange;
18 、 使用otherArray 数组上的位置,替换 range 上的元素
- (void)replaceObjectsInRange:(NSRange)range withObjectsFromArray:(NSArray *)otherArray;
19、对当前的数组排序,使用排序算法
- (void)sortUsingFunction:(NSInteger (*)(id, id, void *))compare context:(void *)context;
20、对当前的数组排序,使用排序算法
- (void)sortUsingSelector:(SEL)comparator;
21、在indexes 的位置上,插入一个数组
- (void)insertObjects:(NSArray *)objects atIndexes:(NSIndexSet *)indexes;
22、移除制定indexes 位置上的元素
- (void)removeObjectsAtIndexes:(NSIndexSet *)indexes;
23、使用一个对象数组,替换 indexes 位置上的 元素
- (void)replaceObjectsAtIndexes:(NSIndexSet *)indexes withObjects:(NSArray *)objects;
24、指定索引替换新的数组元素
- (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx NS_AVAILABLE(10_8, 6_0);
25、排序, 指定块方法排序数组元素
- (void)sortUsingComparator:(NSComparator)cmptr
26、 使用后面的元素进行排序,指定块比较数组
- (void)sortWithOptions:(NSSortOptions)opts usingComparator:(NSComparator)cmptr
27、 创建NSMutableArray 数组
+ (id)arrayWithCapacity:(NSUInteger)numItems;
- (id)initWithCapacity:(NSUInteger)numItems;
0 0
- 2014资料整理--NSArray用法(四)
- 2014资料整理--NSArray用法(一)
- 2014资料整理--NSArray用法(二)
- 2014资料整理--NSArray用法(三)
- 2014资料整理--NSIndexSet用法
- NSArray用法
- Objective-C ---NSArray NSDictionary(梳理整理)
- 四轴学习的资料整理
- NLP(资料整理)
- 资料整理(目录)
- 资料整理(目录)
- 【旧资料整理】firefox addEventListener用法
- MFC TeeChart用法整理 四(保存图片)
- MFC TeeChart用法整理 四(保存图片)
- NSArray 函数整理
- NSArray 函数整理 .
- NSArray类方法整理
- [资料整理]四种代理服务器的原理(二)——SOCKS v5代理服务器的原理
- UIScrollView实现重用机制(类似多列tableview)
- android下xml序列化工具,生成xml文件方法
- List集合的一个常见错误
- OJ_1076 N的阶乘
- 如何设置已经创建的ComBoBox为CBS_DROPDOWNLIST样式
- 2014资料整理--NSArray用法(四)
- C#委托和多线程文章收藏
- 数据库系统的三级模式结构
- 中断处理的上下半部
- Hdu1233 step6.1.4还是畅通工程(克鲁斯卡尔)
- POJ-3187-Backward Digit Sums
- FPGA中的锁存器(latch)、触发器(Flip-flop)、寄存器(register)(待补充)
- Unity3D调用第三方SDK(之一)从eclipse到Unity3D
- tq210 nand配置