Re: Further scripting mysteries
Re: Further scripting mysteries
- Subject: Re: Further scripting mysteries
- From: Brian Webster <email@hidden>
- Date: Wed, 20 Mar 2002 09:12:21 -0600
On Wednesday, March 20, 2002, at 12:44 AM, email@hidden wrote:
It's unclear why NSSetCommand got the key's value before
calling replaceValueAtIndex:inPropertyWithKey:withValue:,
given that it doesn't seem to have any use for it -- perhaps
it was checking that an element at index 0 existed before
trying to set it?
I just implemented a simpler key that gets and sets an
integer value (NSNumber), which seems to work fine. However,
with this key too, interestingly, I'm seeing NSSetCommand get
the value of the key before setting it. In this case I can't
see any reason it would do this; is this a bug? If I were
doing undo, then maybe it would be for that; but there is no
undo manager in my app, and my app is not NSDocument-based so I
shouldn't be getting one for free, as I understand it. Anybody
know why NSSetCommand is behaving this way?
My only guess is that this might be NSSetCommand's way of
testing that the value exists before trying to set it, since
there isn't really any "valueForKeyExists" method in the KVC
extensions. It might be interesting to try running a script
command like "exists frame" to see if it also precipitates a
valueForKey: call.
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.