Situation: I am writing a custom decoder that decodes objects from JSON-based 
archives. My objects gets released prematurely, hence a manual retain is asked 
for.

I need to make this thing work across multiple platforms (that is, Cocoa versus 
GNUstep) but some certain platform does not have the toll-free bridging 
capabilities of CFRetain/CFRelease functions, or even lacked CoreFoundation at 
all (that is, GNUstep can be configured to disable toll-free bridging in their 
implementation of CoreFoundation, or the CoreFoundation library can be missing 
entirely since it is optional to them). Calls to those functions are what I 
have to do to make the decoder work.

On Oct 24, 2013, at 13:22, Chris Hanson <c...@me.com> wrote:

> What Greg says on this topic is authoritative.
> 
>  -- Chris
> 
> Sent from my iPad
> 
>> On Oct 23, 2013, at 4:35 PM, Maxthon Chan <xcvi...@me.com> wrote:
>> 
>> There are still situations that you may want a little touch-up so from time 
>> to time a manual call to these is still needed.
>> 
>>> On Oct 24, 2013, at 2:01, Greg Parker <gpar...@apple.com> wrote:
>>> 
>>>> On Oct 22, 2013, at 7:33 PM, Maxthon Chan <xcvi...@me.com> wrote:
>>>> Despite ARC banned retain/release/autorelease functions, there are still 
>>>> alternatives there in the form of C functions:
>>>> 
>>>> From CoreFoundation <CoreFoundation/CoreFoundation.h>:
>>>> CFRetain() = retain
>>>> CFRelease() = release
>>>> CGBridgingRelease() = autorelease
>>> 
>>> CFBridgingRelease does not autorelease.
>>> 
>>> 
>>>> From LLVM’s requirements to runtime for ARC to work, as prototyped in 
>>>> GNUstep’s <objc/objc-arc.h>:
>>>> objc_retain() = retain
>>>> objc_release() = release
>>>> objc_autorelease() = autorelease
>>>> 
>>>> Prototypes:
>>>> id objc_retain(id);
>>>> void objc_release(id);
>>>> id objc_autorelease(id);
>>> 
>>> Do not call these functions directly.
>>> 
>>> 
>>> -- 
>>> Greg Parker     gpar...@apple.com     Runtime Wrangler
>> 
>> _______________________________________________
>> 
>> 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/cmh%40me.com
>> 
>> This email sent to c...@me.com

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________

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