foundationkit / FoundationKit

Everything that really should be in Foundation, but isn't. Future-proof with ARC
Other
80 stars 9 forks source link

ARC Macro #32

Closed myell0w closed 13 years ago

myell0w commented 13 years ago

I'm currently wrapping my head around ARC, how about such a macro:

if __IPHONE_OS_VERSION_MIN_REQUIRED >= 50000

define __fk_weak weak

else

define __fk_weak unsafe_unretained

endif

Is there any reason why this isn't default, or a problem this could create? The goal is to use zeroing weak references internally if the deployment target is set to iOS 5 or greater and fall back to unsafe_unretained references on iOS 4

myell0w commented 13 years ago

This got added to iOSKit/FKiOSInternal.h.