Setting the value of an array element
Setting the value of an array element
- Subject: Setting the value of an array element
- From: Johnny Lundy <email@hidden>
- Date: Thu, 17 Apr 2008 12:15:23 -0400
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
And I want to change Tom and Dick to Mutt and Jeff.
Is my only option to make it a MutableArray and use
replaceObjectAtIndex:0 and :1 with @"Mutt" and @"Jeff"?
My confusion is that there is no setValue:forIndex:. There is only
setValue: forKey: , but arrays do not have keys.
Is there a way just to set the value of an array element without
replacing it?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden