标签:使用 对象 创建 交换 指定 nsrange 本质 -o pac
NSMutableArray *arr = [NSMutableArray array];
NSMutableArray *arr2 = [[NSMutableArray alloc] initWithCapacity:5];
NSMutableArray *arr3 = [NSMutableArray arrayWithObjects:@"1",@"2", nil];
NSMutableArray *arr4 = [[NSMutableArray alloc] initWithObjects:@"1",@"2", nil];
- (void)addObject:(id)object;
- (void)addObjectsFromArray:(NSArray *)array;
- (void)insertObject:(id)anObject atIndex:(NSUInteger)index;
- (void)removeLastObject;
- (void)removeAllObjects;
- (void)removeObjectAtIndex:(NSUInteger)index;
- (void)removeObject:(id)object;
- (void)removeObjectsInRange:(NSRange)range;
- (void)replaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject;
- (void)exchangeObjectAtIndex:(NSUInteger)idx1 withObjectAtIndex:(NSUInteger)idx2;
NSMutableArray *array = @[@"lnj", @"lmj", @"jjj"]; // 报错, 本质还是不可变数组 [array addObject:@“Peter”];
标签:使用 对象 创建 交换 指定 nsrange 本质 -o pac
原文地址:http://www.cnblogs.com/xufengyuan/p/6636906.html