I'm looking for a better way to do this:
id key, value;
NSMutableDictionary dict;
[dict setObject:value forKey:[NSNumber numberWithInt:(int)key]]
That is, use an NSDictionary to map from address to object.
I'm looking for a better way to do this:
id key, value;
NSMutableDictionary dict;
[dict setObject:value forKey:[NSNumber numberWithInt:(int)key]]
That is, use an NSDictionary to map from address to object.
If you can, use C++'s map:
std::map<id, id> map;
map.insert(std::make_pair(key, value));
You'll have to change the file's extension to .mm
. Also note that it will not retain your values.