I need to store and pass around several paired objects:
1) An NSString of a filename such as “sprite.png”
2) BOOL value for whether or not that sprite should be animated.
So basically, I have a bunch of sprites, and each of them are either animated or not.
I thought I could use an NSDictionary to store everything, but I think using [NSNumber numberWithBool:YES] as the key only allows you to have a single entry with that value.
What sort of structure is most appropriate to pass along that can satisfy my requirements?
I think what you are saying is: I have sprites with a key @”spriteName” mapped to a value [NSNumber numberWithBool].
What are you going to be doing with this container? Like:
Is it going to be holding a large number or is it small?(if its small like less then ten, an array, hash, tree, w.e is arguably irrelevant short term)
Large number or unknown then it matters what you will be doing the most with it?
-adding and removing a lot “NSSet”
-looking individual things up a lot by a comparable key, “NSDictionary”
-iterating through an entire list a lot “NSArray”
Etc….
Etc… These are the kinds of questions you need to ask before you choose a container. There is a container programming guide on Apples resource site for developers, that more or less lays out which container is good for what.