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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:44:38+00:00 2026-05-29T10:44:38+00:00

I am used to working in C# using the linq extensions (list.select(…).where(…) ext), and

  • 0

I am used to working in C# using the linq extensions (list.select(…).where(…) ext), and I was wondering if there was some way of doing the same sort of thing in Objective-C. This would save me from building a number of rather complicated queries using Core Data, which is great for some things, but perhaps not the best for complex queries (or maybe I’m just uninformed).

Is there some kind of equivalent for linq in Objective-C/Core Data?

EDIT: More specifically, I would like to count the number of elements that fit some criteria. Say my model has a field called date. I am trying to select the distinct dates, and then calculate how many of each date there are. In SQL this would be like a group by, and a COUNT aggregate.

  • 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-29T10:44:39+00:00Added an answer on May 29, 2026 at 10:44 am

    Your question goes from very general (“linq equivalent?”) to very specific (computing count by date). I’ll just answer your specific question.

    Unfortunately, NSArray doesn’t have a built-in map or select method, but it does offer NSCountedSet, which will compute what you want:

    NSCountedSet *dateSet = [NSCountedSet set];
    for (id thing in array) {
        [dateSet addObject:[thing date]];
    }
    for (NSDate *date in dateSet) {
        NSLog(@"There are %d instances of date %@", [dateSet countForObject:date], date);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When using source control, the way I am used to working is to develop
I'm used to working in Matlab using its full GUI environment. Due to license
I am working with a method using LINQ to XML to return a string.This
I'm working on a page using ASP.NET MVC3, Razor and Entity Framework. I used
I'm used to working with PHP but lately I've been working with Java and
What profilers have you used when working with .net programs, and which would you
I've been quite used to working on small projects which I coded with 1,000
What would a developer used to working in Visual Studio have to give up
When working on ASP.NET 1.1 projects I always used the Global.asax to catch all
I am working on a collection of classes used for video playback and recording.

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.