Closed jonmorehouse closed 9 years ago
I didn't not before, but you can use something send("#{attr_name}=", value)
and it does work.
yup, that's expected and mirrors the behavior in Objective-C (KVO works by swizzling method, essentially).
You should file a ticket with the RubyMotion folks (motion support
) if you want to investigate instance_variable_set
's behavior
I'm going to file a ticket, I'd like to figure out a way to use this with instance_variable_set
For some reason, using
instance_variable_set
to change a value does not trigger an observer block.I'm guessing this is because of the way that rubymotion handles setting below the scenes, but is there a workaround for setting an instance attribute from a string?