• 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: Core Data: Unable to store a NSData object into an entity's binary property.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data: Unable to store a NSData object into an entity's binary property.


  • Subject: Re: Core Data: Unable to store a NSData object into an entity's binary property.
  • From: Matt Neuburg <email@hidden>
  • Date: Sat, 07 Jan 2006 06:37:01 -0800
  • Thread-topic: Core Data: Unable to store a NSData object into an entity's binary property.

On Fri, 6 Jan 2006 14:05:57 -0800, "Frederick C. Lee" <email@hidden>
said:
>3) Here's a last-minute check of the MOC before SAVING to Storage:
>
>(gdb) po [managedObjectContext insertedObjects]
><NSCFSet: 0x482d0b0> (<NSManagedObject: 0x482ae90> (entity: Map; id:
>0x48269f0 <x-coredata:///Map/t43DB2DD5-3CEC-4AF0-9401-6A2471563D44> ;
>data: {
>     city = nil;
>     country = nil;
>     image = nil;
>     imageData = <4d4d002a 00000008 001400fe 00040000 00010000
>00000100 00030000 000102a3 00000101 00030000 00010203 00000102 0003>;
>     memo = nil;
>     name = "Europe Map";
>     region = 0x34d2e0 <x-coredata://
>2CDD4E18-17BF-4936-9CE7-221131509293/Region/p103>;
>     subregion = nil;
>}))
>
>=================================
>4) After the Save (without errors), I fetch the data and found NO
>IMAGE, only the name (string):
>
>NSSet *fetchedSetName = [[NSSet alloc] initWithSet:[fetchedObject
>valueForKeyPath:@"map.name"]];
>NSSet *fetchedSetImage = [[NSSet alloc] initWithSet:[fetchedObject
>valueForKeyPath:@"map.imageData"]];

This sort of phenomenon is often due to overriding setImageData (or
whatever) but failing to do the dance properly:

willChange... // one, two
setPrimitiveValue...
didChange... // cha-cha-cha

I had a similar problem when I accidentally typed willAccess instead of
willChange in my accessor. m.

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Binding to to-one relationship
  • Next by Date: is this string styled?
  • Previous by thread: Re: Getting the results out of Applescript
  • Next by thread: is this string styled?
  • Index(es):
    • Date
    • Thread