[F-Script-talk] Subclassing NSManagedObject
Brought to you by:
pmougin
From: Tim M. <t_m...@me...> - 2007-01-05 13:49:49
|
Happy New Year I'm playing around with an implementation of f-script which will make use of a subclass of NSManagedObject. I'm writing a core data program contains an "Items" entity linked via a one to many relationship to a "Characteristics" entity. The "Characteristics" entity has two attributes name and value. Each "Item" may contain a number of characteristics which I was planning on accessing by subclassing NSManagedObject so I can make use of the valueForUndefinedKey method to the correct value based upon if the message matched the name attribute, i.e. > Characteristics test which would return something like: {100, 200} Unfortunately, after setting everything up all I got was: > Characteristics test error: an instance of SDTManagedObject does not respond to "test" After playing around with various bit and pieces I finally got it to work using > Characteristics valueForKey: 'test' {100, 200} However I'd prefer to use the more concise commands (ie. "> Characteristics test"). I'm guessing that these don't work because F- script first checks what keys an object support's before sending any message. Could you give me any pointer on what this may be as I think I'll have to customise this method as well? Best Regards Tim |