So is there a countForKey or something similar to that for NSDictionary? I do know that there is a count method but is there something like countForKey or do I have to make a NSDictionary category for it?
Share
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.
Even though
[dictionary count]seems like the easiest approach, you could get the array of keys from the dictionary and then retrieve the array count, so:would return the same as:
EDIT:
With the additional information you provided in the comment, if you want to find out how many ‘keys’ (although your true requirement still isn’t that clear):