#393: Custom accessors for KVO ----------------------------------+----------------------------------------- Reporter: paolo.bosetti@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: KVO ----------------------------------+----------------------------------------- if one creates custom accessors fro object keys to be used for KVO, the setter cannot be made KVO-compliant. The runtime error message is something like: KVO autonotifying only supports -set<Key>: methods that return void. Autonotifying will not be done for invocations of -[MyController setSlider:]. Even making the setter returning nil doesn't work. See the attached example. -- Ticket URL: <http://www.macruby.org/trac/ticket/393> MacRuby <http://macruby.org/>
#393: Custom accessors for KVO ----------------------------------+----------------------------------------- Reporter: paolo.bosetti@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: KVO ----------------------------------+----------------------------------------- Comment(by lsansonetti@…): Reduction: {{{ $ cat t.rb framework 'Foundation' class Foo def setFoo(o) @foo = o end end o = Foo.new o.addObserver(self, forKeyPath: 'foo', options: 0, context: nil) $ ./miniruby t.rb 2009-10-19 20:19:21.599 miniruby[87617:903] KVO autonotifying only supports -set<Key>: methods that return void. Autonotifying will not be done for invocations of -[Foo setFoo:]. }}} I guess we should register setXXX methods with a special ObjC runtime signature automatically (like what attr_writer / attr_accessor do by default). -- Ticket URL: <http://www.macruby.org/trac/ticket/393#comment:1> MacRuby <http://macruby.org/>
#393: Custom accessors for KVO ----------------------------------+----------------------------------------- Reporter: paolo.bosetti@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: minor | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: KVO | ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed Comment: Should be fixed in r2863. -- Ticket URL: <http://www.macruby.org/trac/ticket/393#comment:2> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby