• 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: Serge Meynard <email@hidden>
  • Date: Mon, 14 Mar 2005 14:03:44 -0500

Hi All,

I've run into a situation where it would be great to have a multidimensional NSArray or NSMutableArray. Is there such a class? If not, any suggestions on the most elegant solution?

Thanks,
Daniel

It's actually one of the major annoyances (to me anyway) of working in pure Obj-C code on this project: there is no direct support for multi-dimensional arrays, or even static arrays of PODs. Implementing an NSArray of NSArrays just feels ugly, and the syntax to access items is awful. And having to revert to good old-fashioned C-style indexing (e.g. myArray[y * rowLength + x]) is annoying. Since my arrays are part of larger objects, I end up writing an accessor that looks like [self itemAt:x:y]. I miss the simpler myArray[x][y] syntax of C++, and the STL containers, and the temptation is always there to start mixing the two languages; but I swore to myself I'd write this app in pure Obj-C so I could honestly know what it's like.


_______________________________________________
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


  • Follow-Ups:
    • Re: multidimensional arrays
      • From: Ken Ferry <email@hidden>
    • Re: multidimensional arrays
      • From: Shawn Erickson <email@hidden>
    • Re: multidimensional arrays
      • From: Thomas Davie <email@hidden>
References: 
 >multidimensional arrays (From: Daniel Child <email@hidden>)

  • Prev by Date: Re: Tracking rect woes
  • Next by Date: Re: Does CFNotification center == NSNotification Center?
  • Previous by thread: Re: multidimensional arrays
  • Next by thread: Re: multidimensional arrays
  • Index(es):
    • Date
    • Thread