#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
//可变数组继承不可变数组
//1创建 设定元素个数进行创建
NSMutableArray *str=[NSMutableArray arrayWithCapacity:7];
//2想数组中添加一个元素
NSArray *week=@[@"MON",@"TUE",@"WED",@"THU",@"FRI",@"SAT",@"SUN" ];
NSMutableArray *str1=[NSMutableArray arrayWithArray:week];
[str1 addObject:@"EIG"];
//3根据指定下标插入元素
[str1 insertObject:@"NINE" atIndex:8];
//4删除最后一个元素
[str1 removeLastObject];
//5根据指定下标删除
[str1 removeObjectAtIndex:7];
//6根据指定对像进行删除
[str1 removeObject:@"SUN"];
//7替换指定下标元素
[str1 replaceObjectAtIndex:5 withObject:@"TEN"];
}
return 0;
}