Re: Multidimensiaon Arrays in Cocoa
Re: Multidimensiaon Arrays in Cocoa
- Subject: Re: Multidimensiaon Arrays in Cocoa
- From: Ondra Cada <email@hidden>
- Date: Sun, 23 Sep 2001 15:26:13 +0200
John,
>
>>>>> John C. Randolph (JCR) wrote at Sun, 23 Sep 2001 05:52:41 -0700:
JCR> One trick that just occurred to me for storage of values of a sparse
JCR> array of any number of dimensions, is to keep the values in an
JCR> NSDictionary, where the key is the contatenation of the coordinates.
Actually, it is much cleaner to use an NSArray. Ie., instead of
// a contains the indices
[d setObject:value forKey:[a componentsJoinedByString:@":"]]
you would use directly
[d setObject:value forKey:a]
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc