• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Multidimensional arrays
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: how to identify tooltip instance ?
  • Next by Date: Re: initWithHTML problems
  • Previous by thread: Re: Multidimensional arrays
  • Next by thread: Xcode Modeler and CoreData Fetch Request
  • Index(es):
    • Date
    • Thread