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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use CFDictionary/CFMutableDictionary.
You’ll need to
#import <CoreFoundation/CoreFoundation.h>and possibly add the CoreFoundation framework to your project.When creating the dictionary, specify
NULLfor the key and value callback structures to indicate you don’t want them to be retained.