Re: Web scripting key does not work

Andy Lee <[email protected]> Wed, 20 Oct 2010 23:36:46 -0400
Newsgroups gmane.comp.macosx.devel
Message-ID <[email protected]>
On Oct 20, 2010, at 5:22 PM, Christiaan Hofman wrote:
> Anyway, thanks for your comments, at least it pointed me to the cause. What happened is that the (bar) property I am trying to expose to JS does not correspond to an ivar, but to a generated value (in fact a value in another object; my exposed Foo object is mostly a wrapper to expose stuff to JS). And apparently web object scripting checks /ivars/ of the class, rather than (KVC) /properties/ of the class. Of course there is in general no reason why ivars and properties need to have any relation. Certainly, the docs are wrong on this point.

I noticed in the CallJS example there is a comment that says the getter and setter are not called.  I was going to mention that in my testing they *were* called, at least judging by the NSLogs.  But maybe I was misreading the logs, since you say scripting does indeed go through the ivars.

Anyway, glad you at least got to the bottom of it.

--Andy