Re: Alternative KVC accessors
Re: Alternative KVC accessors
- Subject: Re: Alternative KVC accessors
- From: Shane Stanley <email@hidden>
- Date: Sat, 02 Jan 2010 08:45:07 +1100
- Thread-topic: Alternative KVC accessors
On 1/1/10 11:15 PM, "Mike Abdullah" <email@hidden> wrote:
> Are you saying you want a synthesized -<key> method, and then also write an
> -is<Key> method?
Sort of... What I'm actually trying to do is write a getter in
AppleScriptObjectiveC.
When you declare a property in ASObjC, it seems accessors are synthesized
automatically, as if using @synthesize in ObjectiveC, and you can also write
your own that will used be instead, as in ObjectiveC.
The problem is that methods are written and implemented as handlers in
ASObjC, and AS won't allow a property and a handler to have the same name
(technically, if a variable and handler have the same name, the variable
refers to the handler). That rules out writing the equivalent of a "normal"
-<key> getter.
But if I write a getter in -is<Key> or -get<Key> form, in simple testing
they seem to work fine. is<Key> works with non-booleans, and I wonder
whether the reference to booleans is purely stylistic.
Anyway, what I'm really asking is whether I'm likely to strike unforeseen
problems using the equivalent of -is<Key> or -get<Key> instead of -<key>.
--
Shane Stanley <email@hidden>
AppleScript Pro, April 2010, Florida <http://www.applescriptpro.com>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden