//深複製spa
NSMutableString*str1=[NSMutableString stringWithString:@"one"];orm
NSMutableString*str2=[NSMutableString stringWithString:@"two"];three
NSMutableString*str3=[NSMutableString stringWithString:@"three"];ci
NSMutableArray*array=[NSMutableArray arrayWithCapacity:10];rem
[array addObject:str1];string
[array addObject:str2];it
[array addObject:str3];table
NSMutableArray*array2=[array mutableCopy];im
[array2 removeAllObjects];margin
for (NSMutableString*s in array) {
NSMutableString*temp=[s mutableCopy];
[array2 addObject:temp];
}
NSLog(@"%@",array);
NSLog(@"%@",array2);
NSLog(@"------------");
[array removeObject:str2];
NSLog(@"%@",array);
NSLog(@"%@",array2);