• 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' method in a MO is triggered when the 'key' accessor already exists; why?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

'valueForUndefinedKey' method in a MO is triggered when the 'key' accessor already exists; why?


  • Subject: 'valueForUndefinedKey' method in a MO is triggered when the 'key' accessor already exists; why?
  • From: "Frederick C. Lee" <email@hidden>
  • Date: Wed, 5 Apr 2006 17:23:40 -0700

I have a MO that is a grandchild of NSManagedObject:
{MapManagedObject : EntityManagedObject : NSManagedObject}


Here's one of several hassles I can't figure out.

I have an 'image' accessor, yet the 'valueforUndefinedKey' is
triggered.

Why? or, what could have caused this?

Ric.

MapManagedObject.m:
...
- (NSImage *)image {
    [self willAccessValueForKey:@"image"];
    NSImage *mapImage = [self primitiveValueForKey:@"image"];
    [self didAccessValueForKey:@"image"];
    return mapImage;
}

- (id)valueForUndefinedKey:(NSString *)key {
    return self;  <-- (gdb) break here.
}
...

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

(gdb) po key
image
_______________________________________________
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: Memory Usage Problem
  • Next by Date: Re: +[NSPasteboard pasteboardByFilteringData:ofType:] returns nil
  • Previous by thread: Re: LSUIElement 1 still in Dock?!?
  • Next by thread: focus / tab order completely messed up
  • Index(es):
    • Date
    • Thread