------------------------NSSArray--------------------------------
NSSArray *arr = [[NSSArray alloc] initWithObjects:@"one",nil];
//数组中装有元素的地址 可以是任意对象
NSLog(@"%@", arr);//%@->rewite desciption method
NSEnumerator *enu = [arr objectEnumerator];
id obj;
while(obj = [enu nextObject]){ ... }
for(id obj in arr ){ ... }
-----------------------NSMutableArray--------------------------
NSMutableArray *arr = [[NSMutableArray alloc] init];
[arr addObject:@"one"];
[arr removeObject:@"one"];
[arr removeObjectAtIndex:0];
[arr exchangeObjectAtIndex:0 withObjectAtIndex:1];
NSEnumerator * enu = [arr objectEnumerator];
NSString *str;
while(str = [enu nextObjcet ]){ ... }
-----------------------------------------------------------------------------------------
NSString *str = @"I am a good man";//逆序输出字符串
NSArray *arr = [str componentsSeparatedByString:@" "];//separated string
NSMutableArray *arr1 = [[NSMutableArray alloc]init ];
NSEnumerator *enu = [arr reverseObjectEnumerator];
NSString * obj;
while(obj = [enu nextObject]){
[arr1 addObject:obj]
}
NSString *newStr = [arr1 conponentsJoinByString:@" "];
NSLog(@"%@",newStr);
----------------------------------------------------------------------------------------------------------------