Projects

Ticket #201 (closed defect: wontfix)

Opened 3 years ago

Last modified 23 months ago

rb_objc_define_kvo_setter does not handle the case where the user might override the regular Ruby writer method.

Reported by: eloy.de.enige@… Owned by: lsansonetti@…
Priority: blocker Milestone:
Component: MacRuby Keywords:
Cc:

Description

In my opinion, the setter created by rb_objc_define_kvo_setter should check if the user might have overrided the regular Ruby writer method and call it.

Consider:

class Foo
  attr_accessor :bar

  def bar=(value)
    @bar = 'bar'
    # super # depending on the impl.
  end
end

f = Foo.new
f.bar = "foo"
f.bar # => "bar"
f.setBar("foo")
f.bar # => "foo"

The user will expect the value to always be "bar" as defined in the #bar= impl.

Change History

Changed 23 months ago by eloy.de.enige@…

  • status changed from new to closed
  • resolution set to wontfix

Users should override the #setFoo method.

Note: See TracTickets for help on using tickets.