I have an NSDictionary object with 200 objects and 10 keys.
How do I return a subset and would it have to go to another NSDictionary or to an NSArray?
thanks
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.
The objects stored in
NSDictionaryare stored by key, so if you only have 10 keys, you can only have 10 objects. To illustrate:If you add something to the dictionary with the same key as an existing object, the old object is removed and the new one is added instead.
If you want a dictionary that stores 10 sets of objects per key, you would have to store
NSArrayobjects in your dictionary: