[MacRuby-devel] [MacRuby] #393: Custom accessors for KVO

MacRuby ruby-noreply at macosforge.org
Mon Oct 19 20:20:48 PDT 2009

#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@…):


 $ cat t.rb
 framework 'Foundation'
 class Foo
   def setFoo(o)
     @foo = o
 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

Ticket URL: <http://www.macruby.org/trac/ticket/393#comment:1>
MacRuby <http://macruby.org/>

More information about the MacRuby-devel mailing list