• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Core Data: fetching a subset of attributes/columns
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Core Data: fetching a subset of attributes/columns
      • From: Jim Correia <email@hidden>
    • Re: Core Data: fetching a subset of attributes/columns
      • From: "Hank Heijink (Mailinglists)" <email@hidden>
    • Re: Core Data: fetching a subset of attributes/columns
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Re: NSUserDefaultsController valueForUndefinedKey:
  • Next by Date: Re: Using Set/Array KVC operators
  • Previous by thread: Re: Save As core data question
  • Next by thread: Re: Core Data: fetching a subset of attributes/columns
  • Index(es):
    • Date
    • Thread