Need some help with fetch requests
Need some help with fetch requests
- Subject: Need some help with fetch requests
- From: "Carter R. Harrison" <email@hidden>
- Date: Fri, 1 Feb 2008 15:03:32 -0500
Hi All,
Today I'm working with NSFetchRequests for the first time and I need
some help learning how to filter down the initial set of managed
objects that I want to search against. My application is a sort of
message viewer/editor. A user can open up multiple files, each
containing some number of messages. Messages themselves are broken
down into any number of fields. So my managed object model follows
that same type of hierarchy..
Entity: File
Relationship: Messages
Entity: Message
Relationship: Fields
Entity: Field
Property: Value (string)
When a user performs a search, the search will be performed on the
"Field" entity's "Value" property. I can make this work great with an
NSFetchRequest. My issue is that the search is searching all Field
objects, even if they are owned by a different file. I want to be
able to search just the fields in the currently selected file, rather
than all files that are currently open in the application. Hope that
makes sense. My initial thought was to add more criteria to my
predicate to help narrow down the search base, but I'm not sure how
the predicate's criteria could traverse relationships. Thanks in
advance for the assistance.
Regards,
Carter
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden