lately I work much with arrays and I\'m wonder.. what\'s diffrences between those two lines.
NSArray *array = [NSArray arrayWithArray:someArray];
One of them is probably faster. Run them a million times and see if anyone wins.
In case of NSArray
vs NSMutableArray
, an immutable array being copied does not have to actually return a copy since it can't change. However, if you have a mutable array, it would need to be copied since you could change the original. And of course doing a mutable copy always needs to return a new object.
In your entire app, the speed and memory difference is probably not going to matter compared to everything else that's going on.