• 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
'valueForUndefinedKey' when the 'key' accessor already exists (part deux)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

'valueForUndefinedKey' when the 'key' accessor already exists (part deux)


  • Subject: 'valueForUndefinedKey' when the 'key' accessor already exists (part deux)
  • From: "Frederick C. Lee" <email@hidden>
  • Date: Thu, 6 Apr 2006 12:26:09 -0700

Scenario:
Map --->> MapCoordinates

Abstract:
The MapManagedObject can get updated (with images) WITHOUT errors, IF I DONT
ADD ANY CHILDREN (coordinates). Otherwise, the runtime complains of a missing
(image) accessor that actually does exist in the MapManagedObject.


If it helps to clarify anything, I re-wrote 'loadMapCoordinates ()' (#1 vis #2) using
the child ewBrowserMCController via 'addObject':


===============
#1) revised:

- (void)loadMapCoordinates:(NSNotification *) notice {
	NSLog(@"{EWAppDelegate.m: loadMapCoordinates}");

@try {
[ewBrowserMCController addObject:[self newMapCoordinates: [notice userInfo]]];
}
@catch (NSException *e) {
NSLog(@"{EWAppDelegate.m: loadMapCoordinates} %@",e);
}


    [self activateMapCoordSheet:nil];
}

// ------------------------------------------------------------------------ ------------------------------------------------------------------------ ---
#2) Originally via MOC:
- (void)loadMapCoordinates:(NSNotification *) notice {
NSLog(@"{EWAppDelegate.m: loadMapCoordinates}");


@try {
MapManagedObject *currentMap = [[ewBrowserMapArrayController selectedObjects] objectAtIndex:0];
NSManagedObject *newCoords = [[self newMapCoordinates: [notice userInfo]] retain];


// Attaching the MapCoord link to parent 'Map':
NSMutableSet *MapCoordSet = [currentMap mutableSetValueForKey:@"mapcoordinates"];
[MapCoordSet addObject:newCoords];
[newCoords release];
}
@catch (NSException *e) {
NSLog(@"{EWAppDelegate.m: loadMapCoordinates} %@",e);
}


    [self activateMapCoordSheet:nil];
}

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

The outcome is still the same:

I get the following upon SAVE:

{EWAppDelegate.m: loadMapCoordinates}
*** {MapManagedObject.m: valueForUndefinedKey} key = image***
{EWAppDelegate.m:sheetPanelExit} (tag = 700) [<MapManagedObject 0x64b7f0>
setValue:forUndefinedKey:]: this class is not key value coding- compliant for the key imageData.


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

Note again: 'image' and 'imageData' have accessors within MapManagedObject.

So somehow, programmatically adding a child MO instance to the MOC
and populating it, causes the runtime error upon SAVE.

Any clues?

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
  • Prev by Date: Re: NSCell with Embedded NSView
  • Next by Date: Should I use Sync Services?
  • Previous by thread: 'valueForUndefinedKey' when the 'key' accessor already exists (part deux)
  • Next by thread: Extracting filetype info from image
  • Index(es):
    • Date
    • Thread