Re: Multidimensional arrays
Re: Multidimensional arrays
- Subject: Re: Multidimensional arrays
- From: Jack <email@hidden>
- Date: Sun, 19 Jun 2005 23:54:57 +0200
> If it really is a two dimentional array of objects, then both of your indexes
> are integer values and you'd use one to index the super-array and the other to
> index the sub-array:
>
> id o = [[twoDimArray objectAtIndex:i] objectAtIndex:j];
As James said it all depends on what you want to do with your data. If it
makes sense for you as it seems your arrays will have a predefined depth:
> {0,1,2,3,4,5,6,7,8,9},{0,2,4,6,8,1,3,5,7,9}}
I would consider using a single array with an indexed based on a two
dimensions, if speed is of paramount importance. Such as:
id o = [MyArray objectAtIndex:(i *10)+j];
Jack Frost
http://www.bruji.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden