Is it possible to store multiple objects for a single index in an NSArray?
+1
A:
Sure there are many ways to do this with the most common being to assign a dictionary to each array element
ennuikiller
2010-09-23 02:37:12
A:
Yes, you probably just want to have an NSArray
of NSMutableArray
s. You can then call something like this:
[[array objectAtIndex:2] addObject:obj];
or
[[array objectAtIndex:2] objectAtIndex:1];
cool_me5000
2010-09-23 02:57:13
Instead of addObject shouldn't you use setObject: forKey:? Should objectAtIndex be objectForKey?
awakeFromNib
2010-09-23 04:33:49
`setObject:forKey:` is for dictionaries, cool_me5000's answer is using two arrays
imaginaryboy
2010-09-23 04:52:59