• 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: adding a child data element, saving... 'Selector Not Recognized'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data: adding a child data element, saving... 'Selector Not Recognized'


  • Subject: Core Data: adding a child data element, saving... 'Selector Not Recognized'
  • From: "Frederick C. Lee" <email@hidden>
  • Date: Tue, 4 Apr 2006 12:03:54 -0700

Greetings:
This is what I got when attempting to SAVE a MOC after adding a daughter MO:
*** -[MapManagedObject encodeWithCoder:]: selector not recognized [self = 0x39d7500]


["Western Europe" Map] --->> ["One" MapCoordinates]
MapManagedObject --->> NSManagedObject

Question: What could be the problem 'selector' in this case?

--------------------------

The only 'selector' I can think of is "mapcoordinates" which is the relationship link
between the map (parent) and the coordinates (mapcoordinates).


And as you can see below, the link appears to be okay.

Scenario:
	1) I programmatically created a child MO and added it to the MOC.
        2) I attempted to SAVE the MOC.   <-- bombs
        3) I Checked the MOC via debugger, all appear to be okay.

My remedy attempt:
1) Delete & Rebuilt the persistent data file.
2) Did a b [NSException raise] in the debugger.
      Pending breakpoint 10 - "[NSException raise]" resolved

All I know is that it has something to do with the parent 'MapManagedObject'.
["Western Europe" Map] --->> ["One" Map]
MapManagedObject --->> NSManagedObject



============================
I checked the MOC just before the SAVE and can see the inserted child object, and its parent:


- (BOOL)saveData {
    NSError *error = nil;
-->    if (![[self managedObjectContext] save:&error]) {
        [[NSApplication sharedApplication] presentError:error];
        return FALSE;
    }

    NSLog(@"*** Saved  ***");

    return TRUE;
}

==========================
MapCoordinates MO (child):

["Western Europe" Map] --->> ["One" Map]


(gdb) po [managedObjectContext insertedObjects]
<NSCFSet: 0x3d09a70> (<MapManagedObject: 0x39d7500> (entity: MapCoordinates; id: 0x39c1fc0 <x-coredata:///MapCoordinates/ t586CEC8D-57A7-413D-B501-C1F127D67F7C> ; data: {
map = 0x39eabe0 <x-coredata://0CC53C8C-C0A3-44BA-8291- B9ADD8C48B8F/Map/p2>;
name = One;
x = 272;
y = 106;
}))




==========================
Map MO (abridged parent):

(gdb) po [managedObjectContext objectWithID:0x39eabe0]
<MapManagedObject: 0x39ec0d0> (entity: Map; id: 0x39eabe0 <x- coredata://0CC53C8C-C0A3-44BA-8291-B9ADD8C48B8F/Map/p2> ; data: {
city = nil;
coordinates = nil;
country = nil;
mapcoordinates = (
0x39c1fc0 <x-coredata:///MapCoordinates/t586CEC8D-57A7-413D- B501-C1F127D67F7C>
);
memo = nil;
memoData = nil;
name = "Western Europe";
province = nil;
region = 0x3d04f80 <x-coredata://0CC53C8C-C0A3-44BA-8291- B9ADD8C48B8F/Region/p1>;
url = nil;
})
(gdb)


======================================================================== ==============

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


  • Follow-Ups:
    • Re: Core Data: adding a child data element, saving... 'Selector Not Recognized'
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: Path names in executable
  • Next by Date: Re: Path names in executable
  • Previous by thread: Re: tablecolumn and programmatic bindings
  • Next by thread: Re: Core Data: adding a child data element, saving... 'Selector Not Recognized'
  • Index(es):
    • Date
    • Thread