• 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: Going back to non-ARC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Going back to non-ARC


  • Subject: Re: Going back to non-ARC
  • From: Roland King <email@hidden>
  • Date: Sat, 13 Jun 2015 09:17:57 +0800

> On 12 Jun 2015, at 17:00, John Brownie <email@hidden> wrote:
>
> On Fri Jun 12 2015 18:45:49 GMT+1000 (PGT) Ken Thomases wrote:
>> On Jun 12, 2015, at 3:18 AM, John Brownie <email@hidden> wrote:
>>
>>> Having worked with ARC code for a long while, I discovered an incompatibility with a library that means I have to convert to non-ARC code.
>> Before we address the how, let's make sure of the why.  What is the nature of this incompatibility?  ARC was designed so that code compiled with ARC can interoperate just fine with code compile with manual retain/release, and vice versa.  So, there should be no need to abandon ARC just because of a third-party library.  What lead you to believe there is such a need?
>
> Well, it's the Nano library for handling various data structures such as NS collections, CF collections, strings, etc, in C++. It works fine without ARC, but falls in a heap when trying to compile for Objective-C++. I saw my options as either backing out of ARC, or writing a bunch of shims in plain C to avoid Objective-C++, and the former seemed easier. My model code is mostly C++, with Objective-C for the view and controller parts.

Can you be a bit more illustrative about what ‘falls in a heap’ means? It doesn’t compile, it doesn’t link, it leaks, it crashes all over the place? As everyone’s said so far, this should work. The benefit of ARC over the previous GC technology is that ARC doesn’t really do anything, it just puts all the retains and releases in for you while you’re not looking, and then optimises many of them out again. It’s supposed to work at least as well if not better with C++ which has object lifetimes built right into the structure of the language. If you can give some concrete examples I’m sure you can get some help here making it work.
_______________________________________________

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: 
 >Going back to non-ARC (From: John Brownie <email@hidden>)
 >Re: Going back to non-ARC (From: Ken Thomases <email@hidden>)
 >Re: Going back to non-ARC (From: John Brownie <email@hidden>)

  • Prev by Date: Re: iOS version check
  • Next by Date: Re: Language options: Objective-C, Swift, C or C++?
  • Previous by thread: Re: Going back to non-ARC
  • Next by thread: Re: Going back to non-ARC
  • Index(es):
    • Date
    • Thread