Projects

Ticket #629 (closed defect: fixed)

Opened 2 years ago

Last modified 22 months ago

Bindings not working for subclass

Reported by: dylan@… Owned by: lsansonetti@…
Priority: critical Milestone: MacRuby 0.6
Component: MacRuby Keywords:
Cc:

Description

Binding to a property that is overridden by a subclass causes a 'valueForUndefinedKey:]: this class is not key value coding-compliant for the key' error.

Expected behavior: binding should call the method on the subclass.

I've attached a project that throws this error on launch. The AppDelegate contains Person and Teacher instances. The nib file has a label bound to each. Removing the binding to teacher.name or changing the binding to a property that is not overridden makes the bug go away.

I was using an early nightly for beta 0.6. I've also tested with the latest nightly:

macruby_nightly-2010-03-06-1240.pkg

Attachments

Test.zip Download (45.8 KB) - added by dylan@… 2 years ago.

Change History

Changed 2 years ago by dylan@…

Changed 22 months ago by lsansonetti@…

Still failing with trunk as of today.

Changed 22 months ago by lsansonetti@…

Smaller reduction:

$ cat t2.rb 
class Foo
  def name; 'foo'; end
end

class Bar < Foo
  def name; 'bar'; end
end

o=Bar.new
p o.valueForKey('name')

$ ./miniruby  t2.rb 
NSUnknownKeyException: [<Bar 0x4004b1dc0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key name. (RuntimeError)

Changed 22 months ago by lsansonetti@…

Thibault found out that the Bar method does not have an objc arity of 2 which is causing the exception.

Changed 22 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to MacRuby 0.6

Should be fixed in r3947. Specs were added in 3948.

Note: See TracTickets for help on using tickets.