Re: Setting the value of an array element

2008-04-17 Thread Sherm Pendley
On Thu, Apr 17, 2008 at 12:15 PM, Johnny Lundy <[EMAIL PROTECTED]> wrote: > I imagine this is a very dumb question, but I am perplexed. > > NSArray says you can change the values of elements, but not > add/subtract/replace elements. > > Let's say I have an NSArray @"Tom", @"Dick", @"Harry", nil

Re: Setting the value of an array element

2008-04-17 Thread Gregory Weston
Johnny Lundy wrote: I imagine this is a very dumb question, but I am perplexed. NSArray says you can change the values of elements, but not add/ subtract/replace elements. Right. Meaning if a contained object it mutable, you can mutate it and the NSArray won't care. Let's say I have an N

Re: Setting the value of an array element

2008-04-17 Thread Jens Alfke
On 17 Apr '08, at 9:15 AM, Johnny Lundy wrote: NSArray says you can change the values of elements, but not add/ subtract/replace elements. Nope; NSArrays are completely immutable. To make any modifications you first have to make a mutable copy, and then modify that. (The same goes for NSD