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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:06:57+00:00 2026-06-17T15:06:57+00:00

How do you write a Fetched Property for the Place Entity that will present

  • 0

Xcode Data Model
How do you write a Fetched Property for the Place Entity that will present an Array of Users?

  • 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-17T15:06:58+00:00Added an answer on June 17, 2026 at 3:06 pm

    For a fetched property users of Place that retrieves all users whose check-in is related to the given place, set

    • the destination of the fetched property to “User”
    • and the predicate to “ANY checkins.event == $FETCH_SOURCE”

    enter image description here

    Now you can get the array of users for a place:

    Place *place = ...;
    NSArray *users = [place valueForKey:@"users"];
    

    This fetched property corresponds to the following fetch request:

    Place *place = ...;
    NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"User"];
    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"ANY checkins.event == %@", place];
    [request setPredicate:predicate];
    NSArray *users = [context executeFetchRequest:request error:&error];
    

    If you declare the fetched property users as a dynamic property:

    @interface Place (FetchedProperties)
    @property(nonatomic, retain) NSArray *users;
    @end
    
    @implementation Place (FetchedProperties)
    @dynamic users;
    @end
    

    then you can retrieve the value using property syntax:

    NSArray *users = place.users;
    // instead of: NSArray *users = [place valueForKey:@"users"];
    

    But note that you can get the same result (as a set) directly, without using a fetched property:

    Place *place = ...;
    NSSet *users = [place.checkins valueForKey:@"user"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a procedure that will fire the same select query
How do you write a function that returns a value fetched from server via
write a script that takes two optional boolean arguments,--verbose‚ and ‚--live, and two required
I write app for Android which will be communicate with HTTP server. I need
I am trying to write a generic data transformation routine that is table driven
The value fetched from select property is null. The code for jsp is.. <nested:select
I'm trying to write a Spring web application on a Weblogic server that makes
I've done the following to put a fetched request into an array of arrays
Is there a way to write following query with Linq to Entities (or Entity
I have a class that doesn't extend webapp.RequestHandler , and I can't use self.response.out.write()

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.