From: Aron N. <aro...@gm...> - 2008-05-20 21:23:29
|
Whoops, I'll try that again. Previous attempt inadvertently in HTML; sorry for the spam. A week or so ago I said: > I'm trying to implement property validation methods > (validate<Name>:error:, or, rather, validate<Name>_error in Ruby) in a > Ruby class. I am able to call the validation methods directly from > objc, but they are not called when running > "validateValue:forKey:error:". Turning on RubyCocoa logging shows no > activity on the bridge when validateValue:forKey:error: is called. The list responded: > ... On the off chance that this means nobody happens to know and this is a real problem, here's my workaround: I overloaded validateValue:forKey:error:, for now in the Ruby class with the properties I'm validating: def validateValue_forKey_error(value, key, error) selector = "validate" + key.capitalize + "_error" if (self.respond_to? selector) return self.send(selector, value, error) else return true end end If this is, indeed, a real problem, something like this could go into the Ruby NSObject code. Better would be to fix it in the objc NSObject code, but there's that pesky lack of source code... Again, I'm using the Ruby/RubyCocoa that came with Leopard. -Aron |