• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Alternative KVC accessors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Alternative KVC accessors


  • Subject: Re: Alternative KVC accessors
  • From: Mike Abdullah <email@hidden>
  • Date: Fri, 1 Jan 2010 12:15:51 +0000

On 31 Dec 2009, at 07:03, Shane Stanley wrote:

> The documentation says:
>
> "The format for an accessor method that returns a property is -<key>. The
> -<key> method returns an object, scalar or a data structure. The alternate
> naming form -is<Key> is supported for Boolean properties."
>
> A small number of test suggest -is<Key> is supported more generally.
>
> Elsewhere, the documentation says:
>
> "When the default implementation of valueForKey: is invoked on a receiver,
> the following search pattern is used:
>
> "1. Searches the class of the receiver for an accessor method whose name
> matches the pattern -get<Key>, -<key>, or -is<Key>, in that order. If such a
> method is found it is invoked."
>
> This suggests that all three patterns are supported.
>
> So am I likely to run into problems if I write accessors as -get<Key> or
> -is<Key> for properties that have synthesized accessors?

Are you saying you want a synthesized -<key> method, and then also write an -is<Key> method?
>
> And yes, there's a good reason for wanting to...
>
> --
> 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

_______________________________________________

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

  • Follow-Ups:
    • Re: Alternative KVC accessors
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Drawing on top of QTCaptureView
  • Next by Date: Re: Setting the Line Height/ Line Spacing in an NSTextView.
  • Previous by thread: Re: Drawing on top of QTCaptureView
  • Next by thread: Re: Alternative KVC accessors
  • Index(es):
    • Date
    • Thread