On 1 Jan 2010, at 21:45, Shane Stanley wrote: > On 1/1/10 11:15 PM, "Mike Abdullah" <cocoa...@mikeabdullah.net> 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>.
This sounds a pretty odd approach, and is also going to give you pretty confusing code to read. Instead, how about synthesising a property of the form: -primitive<Key> And then write a getter in -<key> form, so that it internally calls the -primitive<Key> getter? Mike. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com