Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3946790
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:10:30+00:00 2026-05-20T01:10:30+00:00

So is there a countForKey or something similar to that for NSDictionary? I do

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:10:31+00:00Added an answer on May 20, 2026 at 1:10 am

    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:

    NSUInteger keyCount = [dictionary count];
    

    would return the same as:

    NSUInteger keyCount = [[dictionary allKeys] count];
    

    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):

    NSUInteger keyCountForObject = [[dictionary allKeysForObject:object] count];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is this SQL Statement SELECT t1.Name ,Count(t2.SubID) Totals -- I don't know how
There are a lot of questions about upgrading here, but I have another, very
There is a component that I have been using since IE7 and had never
There are many tutorials that talk about deleting index.php from the url. But I
There is some old legacy vbscript code we have that needs some sort of
There are things like f.call(...) f.apply(...) But then there's this (1, alert)('Zomg what is
There is a small topic branch that I'd like to apply on top of
There's a lot of stuff from Scala 2.8.0-RC, but things seem to have changed
There is a website that support shops information like food,drink,golf,spa. This websites provide information
There are numerous places on the Internet, suggesting that it is easily achieved by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.