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 7813361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:50:00+00:00 2026-06-02T04:50:00+00:00

I am familiar with getting a string count from a known array int numberOfWords

  • 0

I am familiar with getting a string count from a known array

    int numberOfWords = [self.wordArray count]; 

but I have an unknown number of strings in an unknown number of arrays, all referenced by a dictionary. This works – good.

   NSMutableDictionary *eqClasses = [[NSMutableDictionary alloc] init];

The arrays and strings are added at runtime (with help of this board):

            NSMutableArray* array = [eqClasses objectForKey:wordPattern];
            if(!array) {
                // create new array and add to dictionary if wordPattern not found
                array = [NSMutableArray array];
                [eqClasses setObject:array forKey:wordPattern];
            }
            [array addObject:tempWordStr];

Now I need to iterate through the dictionary and get the array with the largest word count. Is there a way to scroll through all the arrays in the dictionary without using a key (I won’t know all the word patterns as they are generated dynamically), AND once I find the array with the most words, get that array/value and key/wordpattern?

  • 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-06-02T04:50:01+00:00Added an answer on June 2, 2026 at 4:50 am

    Well, there is a way to get all the keys within a dictionary:

    NSArray *keyArray = [myDict allKeys];
    

    And then you just go through the array and get the object for each key.
    A fast enumeration should work nicely.

    for (NSString *string in NSArray){
        ...
    } //Assuming your keys are strings!
    

    You can save each string to a temporary string, and when encountering a new string, compare to find the longer one. If it’s longer, replace the old string with the longer one.

    Hope this helped! ^_^

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on getting familiar with the Android SDK and I have having
I'm getting familiar with objC, but I'm still confused as to when using C
just getting myself familiar with jquery, please consider me as a noob for now.
I'm not too familiar with networking in JAVA but what i'm basically trying to
I'm totally familiar in making static and dynamic websites. However, I have never dealt
I'm not familiar with ADO.NET Data Services but it looks usable. All I need
Ok guys, this is very basic stuff I think. I'm only getting familiar with
I am not very familiar with the OAuth flow and/or encoding, but I've managed
Just started to getting familiar with graphics in Java. What is the simplest way
I'm familiar (or at least getting familiar) with instance and class methods in objective-c,

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.