Core Data: adding a child data element, saving... 'encodeWithCoder:]: Selector Not Recognized' (with clue)
Core Data: adding a child data element, saving... 'encodeWithCoder:]: Selector Not Recognized' (with clue)
- Subject: Core Data: adding a child data element, saving... 'encodeWithCoder:]: Selector Not Recognized' (with clue)
- From: "Frederick C. Lee" <email@hidden>
- Date: Wed, 5 Apr 2006 13:34:59 -0700
Question: What is Core Data doing?
Why does it have a problem with encodeWithCoder?
The 'image' appears good (see output below).
This following code is where the error occurs.
The debugger doesn't break here, so I had to check
via runtime. I made no changes the the map data;
I only added a new 'MapCoordinates' object (Map's child).
// ============================
// MapManagedObject.m:
- (void)willSave {
NSImage *image = [self primitiveValueForKey:@"image"];
if (image != nil) {
NSLog(@"{MapManagedObject.m: willSave} image= %@",image);
[self setPrimitiveValue:[NSArchiver
archivedDataWithRootObject:image]
forKey:@"imageData"];
}
else {
[self setPrimitiveValue:nil forKey:@"imageData"];
}
[super willSave];
}
==============================
*** Clue #1:
Replacing 'willSave' routine above with the following (without the
NSArchiver)
Gives me the SAME Error: -[MapManagedObject encodeWithCoder:]:
selector not recognized [self = 0x3794c50]
.
- (void)willSave {
[super willSave];
}
========================================================================
=
The following is what I'm getting (via original code):
{MapManagedObject.m: willSave} image= <MapManagedObject: 0x3d014a0>
(entity: MapCoordinates; id: 0x38cec60 <x-coredata:///
MapCoordinates/t0C81AD68-467F-4FA2-990F-0F41F0CF9EB4> ;
data: {
coordString = "{342, 107}";
map = 0x38c6480 <x-coredata://0CC53C8C-C0A3-44BA-8291-
B9ADD8C48B8F/Map/p2>;
name = One;
})
*** -[MapManagedObject encodeWithCoder:]: selector not recognized
[self = 0x3d014a0]
Any ideas what's going on here? ...Remedy?
BTW: I made a simpler model of the routine and it appeared to okay.
Ric.
_______________________________________________
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