• 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: Properties: A question of style
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Properties: A question of style


  • Subject: Re: Properties: A question of style
  • From: Michael Starke <email@hidden>
  • Date: Wed, 15 Jun 2016 10:03:14 +0200

If I've though longer about my answer I would have seen that you only talk about read-only properties, I could have saved the comment. It's only useful for readwrite properties, because only then the asymmetric getter/setter situations can occur.

>
>>
>> Hi all,
>>
>> Just a quick point for discussion.
>>
>> Suppose I have a read-only BOOL property. What’s better, to declare it as:
>>
>> @property (readonly) BOOL isFoo;
>>
>> or:
>>
>> @property (readonly, getter=isFoo) BOOL    foo;
>>
>>
>> Is there any advantage to one over the other? n.b. I’d always use the latter form for read/write properties, it’s readonly ones that I’m wondering about.
>>
>> —Graham
>>
>
> Since I just ran into this the other day. If you tend to use NSStringFromSelector for creating binding keys the use of a custom setter or getter is a bit inconvenient as you need to supply the name compatible with setValueForKey/getValeForKey otherwise the binding system will fail because of an unknown selector being used either for the setter or the getter or if both are custom both. Or I just "held it wrong"
>
> ___m i c h a e l  s t a r k e____
> geschäftsführer
> HicknHack Software GmbH
> www.hicknhack-software.com
>
> ___k o n t a k t____
> +49 (170) 36 86 1 36
> email@hidden
>
> ___H i c k n H a c k S o f t w a r e G m b H____
> geschäftsführer - maik lathan | andreas reischuck | michael starke
> bayreuther straße 32
> 01187 dresden
> amtsgericht dresden HRB 30351
> sitz - dresden
>


_______________________________________________

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


References: 
 >Properties: A question of style (From: Graham Cox <email@hidden>)
 >Re: Properties: A question of style (From: Michael Starke <email@hidden>)

  • Prev by Date: Re: Properties: A question of style
  • Next by Date: Re: UINavigationController back gesture animation
  • Previous by thread: Re: Properties: A question of style
  • Next by thread: Re: Properties: A question of style
  • Index(es):
    • Date
    • Thread