removeObject 移除一个不存在的对象,不会报错
NSArray *arr = @[@"1",@"2",@"3"];
NSMutableArray *marr = [[NSMutableArray alloc] initWithArray:arr];
[marr addObject:@"3"]; //变成 1,2,3,3
[marr removeObject:@"4"];//###无错误,保持不变
2
removeObject 移除一个不存在的对象,不会报错
NSArray *arr = @[@"1",@"2",@"3"];
NSMutableArray *marr = [[NSMutableArray alloc] initWithArray:arr];
[marr addObject:@"3"]; //变成 1,2,3,3
[marr removeObject:@"4"];//###无错误,保持不变
2