Re: multidimensional arrays
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