On Feb 20, 2016, at 23:07 , Ilya Kulakov <kulakov.i...@gmail.com> wrote:
> 
> Checking version of the OS is the least problem. Providing an implementation 
> is the actual one.
> I want to use weaks, because they are easier for developers who are tought by 
> new documentation and didn't learn to explicitly nullify references to 
> objects like delegate. Not saying that one would want to this logic in an app 
> that targets newer versions of OS X.

Ah, I see.

Assuming the compiler version you’re using accepts ‘weak’, then that should 
function as a non-zeroing weak reference on OS X versions that don’t have 
support for zeroing. You could then document that clients targeting 10.6 must 
nullify the delegate before deallocating it, leaving the convenience of zeroing 
to more “modern” clients, without having to write any zeroing code yourself, or 
using any conditional code at compile time or run time. 

(But check that this is actually feasible. I realize I might be confusing the 
old GC zeroing weak with ARC zeroing weak, if there’s a difference in effective 
functionality.)

_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to