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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:31:35+00:00 2026-06-18T11:31:35+00:00

Lets say I have an entity with an attribute called animalType. Within core data

  • 0

Lets say I have an entity with an attribute called animalType.
Within core data I have 10,000 of these entities and there are an unknown amount of different animal types, Eg. dog, cat, bird, etc.
Can I tell core data to fetch each animal type and return an array similar to:

@[Dog, Cat, Bird, Fish, ...]

I don’t want to fetch an array of entities I just want a unique list of animalTypes.
No animalType should be repeated.

  • 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-18T11:31:37+00:00Added an answer on June 18, 2026 at 11:31 am

    Yes, you’ll want NSFetchRequest‘s setReturnsDistinctResults: method, combined with setPropertiesToFetch: and setResultType: NSDictionaryResultType. Basically, the fetch will return an array of dictionaries, and those dictionaries will in turn contain key-value pairs corresponding to the specific properties you fetch– in your case, each dictionary having one key, animalType, and a distinct value for that key. Converting that into an array like the one you describe would be straightforward.

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

Sidebar

Related Questions

For example, lets say I have an entity called user and an entity called
Lets say I have an entity called User which has many Posts. My service
Lets say I have a entity model with three entities Item, ItemType and ItemPart.
Lets say we have the following entities. Entity A Entity B Entity C The
Lets say I have entities Article, Page and Category. I want entity Article to
Lets say I have a core data model like this one: Item attributes: name
Lets say in an application you have an entity called User. Each User can
Lets say thay I have an entity with name A.It has two columns named
I have a question regarding foreign key in entity framework(EF4). Lets say i have
Lets say we have a table here, populated with the following data: acc_id1 acc_id2

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.