Core Data: fetching a subset of attributes/columns
Core Data: fetching a subset of attributes/columns
- Subject: Core Data: fetching a subset of attributes/columns
- From: Gabriel Fernandez <email@hidden>
- Date: Sat, 20 Mar 2010 13:52:32 -0400
I wanted to get a subset of an entity's attributes because one of the ManagedObject's attributes is a large image.
I've tried
1) creating a blank Managed Object Model and adding only the attributes I want, but of course the PSC says
that the MOM that was used to create the store is different, and returns an error.
2) using the -setPropertiesToFetch: method of NSFetchRequest, with the "id" NSAttributeDescription I'm looking for as the only object in the properties array. But when I use the -(NSArray*) properties method of the fetched objects, the "image" attribute is there with a non-nil value.
3) I ended up using one of the NSExpression expressions to get the value I wanted, using the example in the Core Data Programming Guide.
Out of curiosity, does anyone have experience using the -setPropertiesToFetch with anything other than an NSExpressionDescription?
Thanks,
Gabe
----------------------------------------------------------------
Gabriel Fernandez
Wheel Software
_______________________________________________
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