[MacRuby-devel] KVC: different behaviour with set and =

B. Ohr jazzbox at 7zz.de
Mon May 17 01:28:56 PDT 2010


Ooops, shame on me, you are right. Now it is working….

Am 17.05.2010 um 10:20 schrieb Vincent Isambart:

>> class Controller < NSWindowController
>>  attr_accessor :test
>>  def works
>>    setTest true
>>  end
>>  def doesnotwork
>>    test = true
>>  end
>> end
> 
> "test = true" should be "self.test = true"
> "test = true" just creates a local variable named test.
> It's a very common mistake in Ruby.
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel



More information about the MacRuby-devel mailing list