Re: NSMutableArray problems
Re: NSMutableArray problems
- Subject: Re: NSMutableArray problems
- From: Sascha Kuehn <email@hidden>
- Date: Tue, 23 Mar 2004 19:07:47 +0100
i finaly got it!
thanks for your help
sascha
On 22. Mrz 2004, at 0:06 Uhr, email@hidden wrote:
I missed the first part of this post so I'm probably speaking
foolishly...
but.
2 things.
if the arrays in the main array are not mutatable then you must build
a
new array and replace the one you other wise want to edit. (how many
times can we say array in a sentence)
NSArray * theNewlyEditedArray = [NSArray
arrayWithObjects:anObject,anotherObject,etc,nil];
//here you have to rebuild your array kind of from scratch.
[mainArray replaceObjectAtIndex:index withObject:theNewlyEditedArray];
I have used this and similar methods involving arrays to edit or
maintain
table/outline data
if the arrays in the main array are mutatable:
[[mainArray objectAtIndex:index] replaceObjectAtIndex:otherIndex
withObject:theNewObject];
//If the arrays in the main array are mutatable then you only need to
change the objects and not the whole array.
Ive used this method a number of times to replace data in drag and
drops
or simply edit data in a cell without messing with the rest of an
array.
April.
Are the arrays in the arrayOfRows also mutable arrays?
Charles
On Mar 21, 2004, at 8:27 AM, Sascha Kuehn wrote:
arrayOfRows is a mutablearray of arrays
On 21. Mrz 2004, at 15:18 Uhr, Alan Donsky wrote:
if arrayOfRows in a NSMutableArray, then i think all u need is
[arrayOfRows replaceObjectAtIndex:j withObject:theString];
Alan
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.