Re: Stupid objective-c question
Re: Stupid objective-c question
- Subject: Re: Stupid objective-c question
- From: Alastair Houghton <email@hidden>
- Date: Fri, 23 Sep 2016 10:32:30 +0100
On 23 Sep 2016, at 10:04, Quincey Morris <email@hidden> wrote:
>
>> static void* kMyContext = &kMyContext;
>
> That makes the “&” optional (at comparison time), and it should even avoid the coalescing problem if it’s declared const.
Yes, that’s a good way to do it.
It might be a good idea for Apple to have a macro for this purpose, so you could write
NS_DECLARE_KVO_CONTEXT(kMyContext);
as that would avoid any confusion whatsoever (filed as rdar://28444442).
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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