Re: setValue:forUndefinedKey:
Re: setValue:forUndefinedKey:
- Subject: Re: setValue:forUndefinedKey:
- From: Tore Halset <email@hidden>
- Date: Thu, 12 Oct 2006 09:39:22 +0200
On Oct 12, 2006, at 3:10, Keary Suska wrote:
on 10/11/06 5:03 PM, email@hidden purportedly said:
My current solution is to implement a setValue:forUndefinedKey: that
look up in the Dictionary for properties that do not have a separate
set method. It is working. Is this a good idea or should I override
setValue:forKey: instead?
Using setValue:forUndefinedKey: is the only way I have found to do
this. If
you override setvalue:forkey: you will have to handle KVO
notifications in
your override, or your bindings won't update properly. So it's an
easier
solution, however inelegant.
Okay, thanks. My problem with overriding setValue:forKey: is that any
custom set/get methods are not called. I guess my custom
setValue:forKey: should follow key-value search ordering and look for
custom set/get methods for the given key. Would like to see some
examples on how to do this? :)
Core Data/NSManagedObject is probably a more elegant solution but I
haven't
pursued it yet.
I am not able to use NSManagedObject on this, but it looks like
NSManagedObject has solved this issue in some sort. But how?
- Tore.
_______________________________________________
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