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

  • Home
  • SEARCH
  • 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 7684571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:03:33+00:00 2026-05-31T19:03:33+00:00

Hello, i’m trying to take detailed information from the database, i create a simple

  • 0

Core Data

Hello, i’m trying to take detailed information from the database, i create a simple database, and i display the Grocery attribute fruit in a table view for example:
Apple
Grapes
Strawberry
Melon
…
if i click on the apple row for example,i want retrieve the details information for that object: so i want see only the the fruitName grouped for fruitID, for example there are a lot of apple fruit type, and every type have a id…so i want see only the apple Type for a ID, i hope i’m explain well the problem.

i found only this method:

- (NSArray *)sortFruit {
NSSortDescriptor *sortLastNameDescriptor = [[NSSortDescriptor alloc] initWithKey:@"fruitID" ascending:YES];
NSArray *sortDescriptors = [NSArray arrayWithObjects:sortLastNameDescriptor, nil];
return [[[fruit valueForKey:@"detailes"] allObjects] sortedArrayUsingDescriptors:sortDescriptors];
}

but in this way i can only take all detail for that fruit, and sorted by fruitID, but i can’t choose a value…so i can’t see only a specific fruitID group…

EDIT: Thank you very much for the answer, ok now in this way:

NSPredicate *predicate = [NSPredicate
                          predicateWithFormat:@"%K == %@",
                          @"fruitID", [NSNumber numberWithInt:0]];
NSArray *arrayfiletered = [[self sortEpisode] filteredArrayUsingPredicate:predicate];

i can retrieve the info for a specific fruitID, but there is a way to see how many different fruitID there are for that fruit?

  • 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-31T19:03:34+00:00Added an answer on May 31, 2026 at 7:03 pm

    The answer you want is in the NSPredicate class. See specifically the function filteredArrayWithPredicate: in the NSArray class. It will return a new array based on the predicate that you pass in. This is an article about how to use predicates.

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

Sidebar

Related Questions

Hello I'm trying to take backup from mysql command line client. I'm using mysqldump
Hello and thank you in advance, I am trying to create a django form
Hello i´m trying to set info from a post method into a variable that
Hello I am trying to create a stacked barplot using the following code: test
Hello I am building a website using JSF 2.0. I am trying to set
Hello all and thanks for the help, I need to write every row from
Hello I am trying to match the button down visual (on the WinForm, the
Hello I'm trying to convert youtube links into embed code. this is what I
Hello everyone i am trying to format the input number range with php number_format
hello friends i am trying to get a list of user id and want

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.