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 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 I am trying to create a stacked barplot using the following code: test
Hello again ladies and gents! OK, following on from my other question on ASP.NET
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
Hello Guys I am trying to figure out why i am gettings this error
Hello All I am trying to flatten a list in Ocaml. I am a
Hello I am trying to implement a wake lock for an application. PowerManager pm
Hello following problem, i need the id attribute string for each div in a
hello i wanted to build I get $date and $date1 from form xxx. I

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.