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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:34:23+00:00 2026-06-19T01:34:23+00:00

I have an NSArrayController filled with NSMutableDictionary objects. The following code is working without

  • 0

I have an NSArrayController filled with NSMutableDictionary objects. The following code is working without any problem but I would like to get rid of the compiler warning I get. Collection expression type 'NSManagedObject *' may not respond to 'countByEnumeratingWithState:onjects:count:'
As far as I understand, I get this error because the array controller COULD have also different types of objects inside that do not have a key value. But in my case I am only using mutable dictionaries so it should be ok.

Here is my code:

- (IBAction)getlist:(id)sender{
    checkedchecks = 0;
    for (NSManagedObject *a in imagescontroller.arrangedObjects)
    {
        for (NSString* key in a) {

            if ([[NSString stringWithFormat:@"%@",[a valueForKey:key]] isEqualToString: @"1"])
            {
                checkedchecks += 1;
            }
        }
    }
    NSAlert *alert = [[NSAlert alloc] init] ;
    [alert setMessageText:[NSString stringWithFormat:@"%ld",(long)checkedchecks ]];
    [alert runModal];
}

How could i get rid of this annoying warning?

  • 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-19T01:34:24+00:00Added an answer on June 19, 2026 at 1:34 am

    Why are you typing a as an NSManagedObject * if it’s an NSMutableDictionary *?

    for (NSMutableDictionary *a in imagescontroller.arrangedObjects)
    

    is probably what you want.

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

Sidebar

Related Questions

I have an NSArrayController and I would like to sort the contents so that
I have an NSTableView which is bound to an NSArrayController. I would like to
I have a NSArrayController with following Object: @interface AdressCard : NSObject <NSCoding> { NSString*
I currently have a NSArrayController whose content property is (programmatically) set to an NSMutableDictionary
I have a NSArrayController bound to an NSTableView so the table column like the
I have a list of objects displayed in an NSTableView (bound to an NSArrayController).
I have an NSView and an NSArrayController and I'd like to bind some values
I have a NSArrayController bound to an array in one of my objects. I
I have 2 Entities, related by a many-to-many relationship. Thing<<->>Tag There is one NSArrayController
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=

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.