• 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
re: Fetch Requests on Non Standard Classes in Core Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: Fetch Requests on Non Standard Classes in Core Data


  • Subject: re: Fetch Requests on Non Standard Classes in Core Data
  • From: Ben Trumbull <email@hidden>
  • Date: Sun, 17 May 2009 15:10:11 -0700

To make matters worse though, the guid is wrapped in what is effectively a
container class which includes network serialization functionality, an
isEqual method, etc along with the 16 bytes of guid data. If possible I
would like to store the wrapper object in Core Data rather than extracting
data from it and then rebuilding it each time I store/retrieve the object.
It seems eminently possible to do the actual storage/retrieval using an
NSValueTransformer with a Transformable attribute, but what is hurting my
brain is the idea of lookups. How (if at all) can I store these wrapper
objects in such a way that I can do fetch requests based on their internal
values?

Transformable attributes are stored as binary blobs in the db. The container class is strictly an artifact of the runtime in memory representation.


Core Data supports == and != searches against binary data. You should be able to just use a predicate like:

[NSPredicate predicateWithFormat:@"myTransformableAttribute = %@", myGuidObject]

and have it "just work". If it doesn't on 10.5.7, please file a bug report.

- Ben

_______________________________________________

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:
    • NSExpression with constant NSData value crashes Core Data
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: [iPhone] Settings Application...need an Image Picker
  • Next by Date: Re: Core Data Predicate Bug?
  • Previous by thread: Re: Fetch Requests on Non Standard Classes in Core Data
  • Next by thread: NSExpression with constant NSData value crashes Core Data
  • Index(es):
    • Date
    • Thread