Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COThanks Tim. WRT answer 2, yes I can now access all the stats for a team as per your example, and since I have inverse relationships to the 'player' and the 'game' from the stats object I guess I can further refine that array by cycling through each object and testing for these objects. My concern is that the [team stats] NSSet may be very large and that would be loaded into memory in order to do the other tests. Is there a more efficient way to do this? For example having the database do the work as opposed to the client? Truth is there are more attributes to filter on(was keeping simple)
      singulars
    2. COJMH: I'd recommend reading up on faults, especially in the Core Data Programming Guide and the NSManagedObject class reference. Notably, you can call `isEqual:` on managed objects without firing a fault, which makes it possible for you to iterate through that set without a large memory requirement. If you need to access properties of each managed object, though, you're right - it's probably more efficient for you to construct a fetch request with NSPredicate to do the work. In that case, I believe your original example would work using `==` comparison.
      singulars
    3. COTim, the faults info in the Core Data Programming Guide was right on the money. Thanks. I think I will use NSPredicates to do the work in most cases. I guess it wouldn't hurt to keep the relationships as defined in my original question.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload