Ojbect-C2 3、NSArray和NSMutableArray数组的使用
Adopted Protocols
Tasks
Creating an Array
+ array+ arrayWithArray:--+ arrayWithContentsOfFile:--从文件中初始化数组+ arrayWithContentsOfURL:+ arrayWithObject:--只能初始化一个元素+ arrayWithObjects:--初始化多个元素+ arrayWithObjects:count:
Initializing an Array
– init– initWithArray:– initWithArray:copyItems:– initWithContentsOfFile:– initWithContentsOfURL:– initWithObjects:– initWithObjects:count:
Querying an Array
– containsObject:-- 是否包含字符串– count--获取元素中的个数– getObjects:range:– firstObject– lastObject– objectAtIndex:--访问数组中的某个元素– objectAtIndexedSubscript:– objectsAtIndexes:– objectEnumerator– reverseObjectEnumerator– getObjects:Deprecated in OS X v10.6
Finding Objects in an Array
– indexOfObject:– indexOfObject:inRange:– indexOfObjectIdenticalTo:– indexOfObjectIdenticalTo:inRange:– indexOfObjectPassingTest:– indexOfObjectWithOptions:passingTest:– indexOfObjectAtIndexes:options:passingTest:– indexesOfObjectsPassingTest:– indexesOfObjectsWithOptions:passingTest:– indexesOfObjectsAtIndexes:options:passingTest:– indexOfObject:inSortedRange:options:usingComparator:
Sending Messages to Elements
– makeObjectsPerformSelector:– makeObjectsPerformSelector:withObject:– enumerateObjectsUsingBlock:– enumerateObjectsWithOptions:usingBlock:– enumerateObjectsAtIndexes:options:usingBlock:
Comparing Arrays
Deriving New Arrays
– arrayByAddingObject:--追加数组的内容– arrayByAddingObjectsFromArray:– filteredArrayUsingPredicate:– subarrayWithRange:
Sorting
– sortedArrayHint– sortedArrayUsingFunction:context:– sortedArrayUsingFunction:context:hint:– sortedArrayUsingDescriptors:– sortedArrayUsingSelector:– sortedArrayUsingComparator:– sortedArrayWithOptions:usingComparator:
Working with String Elements
– componentsJoinedByString:-- 数组-->字符串
Creating a Description
– description– descriptionWithLocale:– descriptionWithLocale:indent:– writeToFile:atomically:– writeToURL:atomically:
Collecting Paths
Key-Value Observing
– addObserver:forKeyPath:options:context:– removeObserver:forKeyPath:– removeObserver:forKeyPath:context:– removeObserver:fromObjectsAtIndexes:forKeyPath:context:– addObserver:toObjectsAtIndexes:forKeyPath:options:context:– removeObserver:fromObjectsAtIndexes:forKeyPath:
Key-Value Coding
Tasks
Creating and Initializing a Mutable Array
Adding Objects
Removing Objects
– removeAllObjects– removeLastObject– removeObject:– removeObject:inRange:– removeObjectAtIndex:– removeObjectsAtIndexes:– removeObjectIdenticalTo:– removeObjectIdenticalTo:inRange:– removeObjectsInArray:– removeObjectsInRange:– removeObjectsFromIndices:numIndices:Deprecated
in OS X v10.6
Replacing Objects
– replaceObjectAtIndex:withObject:– setObject:atIndexedSubscript:– replaceObjectsAtIndexes:withObjects:– replaceObjectsInRange:withObjectsFromArray:range:– replaceObjectsInRange:withObjectsFromArray:– setArray:
Filtering Content
Rearranging Content
Class Methods
Ojbect-C2 3、NSArray和NSMutableArray数组的使用的更多相关文章
- iOS阶段学习第15天笔记(NSArray与NSMutableArray 数组)
iOS学习(OC语言)知识点整理 一.OC中的数组 1)数组:也是一个对象,数组中存放的是对象的地址,可以存放任意类型对象的地址,只能是对象不能是具体的数值,数组是有序的, 可以存放重复的元 ...
- NSArray与NSMutableArray 数组与可变数组
1.NSArray 是一个父类,NSMUtableArray是其子类,他们构成了OC的数组.2.NSArray的创建NSArray * array = [[NSArray alloc]initWith ...
- NSArray与NSMutableArray 数组与可变数组的创建和遍历 复习
1.NSArray 是一个父类,NSMUtableArray是其子类,他们构成了OC的数组. 2.NSArray的创建 NSArray * array = [[NSArray alloc]initWi ...
- IOS数组NSArray与NSMutableArray知识点
此文是对数组NSArray与NSMutableArray知识点的总结,主要是一些常见的操作,别外一些操作见其相应的文档,下面的代码部分还运用的第三方插件BlocksKit相结合: a:Foundati ...
- 15.Object-C--浅谈Foundation框架OC数组NSArray与NSMutableArray
昨天总结了一下NSString与NSMutableString,今天我在这里总结一下NSArray与NSMutableArray. NSArray数组是:不可变数组. nil 是数组元素结束的标记.O ...
- IOS - Objective-C NSArray和NSMutableArray的详解 使用
原文地址:http://blog.csdn.net/totogo2010/article/details/7729377 Objective-C的数组比C++,Java的数组强大在于,NSArray保 ...
- OC知识梳理-NSArray与NSMutableArray相关知识
知识普及: 1.数组中的元素在系统中都会有其默认对应的下标,下标是一个整形的数字,默认从0开始. 例:NSArray *arr3 = @["345","234" ...
- NSArray、NSMutableArray基本用法
NSArray.NSMutableArray基本用法 一.基本操作 初始化方法:1.init返回一个空数组 2.initWithArray从已有数组初始化 3.initWithContentsOfFi ...
- Objective-C语法之NSArray和NSMutableArray
转自:http://www.cnblogs.com/stoic/archive/2012/07/09/2582773.html Objective-C的数组比C++,Java的数组强大在于,NSArr ...
随机推荐
- R语言 典型相关分析
1.关键点 #典型相关分析##典型相关分析是用于分析两组随机变量之间的相关程度的一种统计方法,它能够有效地揭示两组随机变量之间的相互(线性依赖)关系#例如 研究生入学考试成绩与本科阶段一些主要课程成绩 ...
- 网络流相关(拓扑)CodeForces 269C:Flawed Flow
Emuskald considers himself a master of flow algorithms. Now he has completed his most ingenious prog ...
- C#中的四舍五入算法
最近在产品开发过程中遇到一个问题,就是在对数值进行截取,例如说保留两位小数时,最终得到的结果跟预期的在某些情况下会产生差异,这个差异的表现就是最后一位与预期的不一致,也就是说在"四舍五入&q ...
- 汇编学习笔记(14)BIOS对键盘输入的处理
字符的处理 键盘输入的字符一般由int9中断例程从60h端口中读取,并存放在键盘缓冲区中,由int16h例程从键盘缓冲区中读取相应字符,CPU对键盘输入a.shift_a的处理过程如下 1.一开始没有 ...
- BlogEngine.Net
BlogEngine.Net架构与源代码分析系列part1:开篇介绍 2008-11-05 15:27 by GUO Xingwang, ...阅读, ...评论, 收藏, 编辑 最近我要开始这个系列 ...
- zoj 1671 Walking Ant【简单bfs】
Walking Ant Time Limit: 2 Seconds Memory Limit: 65536 KB Ants are quite diligent. They sometime ...
- 不同车型 不同起步价不同费用的问题(switch语句)
#include "stdio.h" #include "math.h" main() { int a; float meet,b; printf(" ...
- 常用Dos命令笔记
0x00 磁盘FAT32格式转NTFS convert e: /fs:ntfs Tips: 语法规则: Converts a FAT volume to NTFS. CONVERT volume /F ...
- 洛谷 P1005 矩阵取数游戏
题目描述 帅帅经常跟同学玩一个矩阵取数游戏:对于一个给定的n*m的矩阵,矩阵中的每个元素aij均为非负整数.游戏规则如下: 1.每次取数时须从每行各取走一个元素,共n个.m次后取完矩阵所有元素: 2. ...
- [置顶] 提高生产力:开源Java工具包Jodd(Java的”瑞士军刀”)
官方网站:http://jodd.org/ 下载地址:http://jodd.org/download/index.html Jodd=tools + ioc + mvc + db + aop + t ...