ARC apps - loading non-ARC bundles

  • Hi all,

    I'm (finally) looking at converting my non-ARC (Mac OS X) app over to ARC,
    but also have quite a few external plugins/bundles which can be loaded into
    the main app on runtime.
    My question is - can my ARC app load non-ARC bundles, or is this not
    possible.

    My guess is that it's the similar case to a 64 bit app trying to load 32
    bit bundles (of course, not possible) but I'd just like some clarification
    before I go ahead with the switch.

    Thanks
  • On 18 May 2012, at 9:39 AM, Patrick Robertson wrote:

    > My question is - can my ARC app load non-ARC bundles, or is this not
    > possible.

    Yes, it can link to (including loading) non-ARC code.

    — F
  • Did that once with the SVProgressHUD by Sven Vermette, which is non-ARC as well.

    If you add "-fno-objc-arc" in Build Phases / Compile Sources / Compiler Flags, it should work.

    HTH

    Marcus

    Am 18.05.2012 um 16:39 schrieb Patrick Robertson:

    > Hi all,
    >
    > I'm (finally) looking at converting my non-ARC (Mac OS X) app over to ARC,
    > but also have quite a few external plugins/bundles which can be loaded into
    > the main app on runtime.
    > My question is - can my ARC app load non-ARC bundles, or is this not
    > possible.
    >
    > My guess is that it's the similar case to a 64 bit app trying to load 32
    > bit bundles (of course, not possible) but I'd just like some clarification
    > before I go ahead with the switch.
    >
    > Thanks

    MacStrass - Marcus Straßmann
    Softwareentwicklung und Beratung
    Auf der Markscheide 35
    D-44807 Bochum

    Mobil: +49 (173) 374 39 92
    eMail: <macstrass...>
    Web: http://www.macstrass.de
  • On May 18, 2012, at 8:49 AM, Fritz Anderson wrote:

    > Yes, it can link to (including loading) non-ARC code.

    By which I assume you mean old-style retain/release code, not GC?

    --
    Scott Ribe
    <scott_ribe...>
    http://www.elevated-dev.com/
    (303) 722-0567 voice
  • On May 18, 2012, at 7:39 AM, Patrick Robertson wrote:

    > I'm (finally) looking at converting my non-ARC (Mac OS X) app over to ARC,
    > but also have quite a few external plugins/bundles which can be loaded into
    > the main app on runtime.
    > My question is - can my ARC app load non-ARC bundles, or is this not
    > possible.

    ARC code can load manual RR code (and vice versa). This property is relied upon by the OS. The most important thing to cross compatibility is that both sides understand and follow the Cocoa memory management conventions (or annotated exceptions), as otherwise you can get over-retain and over-release bugs at the boundaries.
    --
    David Duncan
  • Thanks all, you've saved me a fair bit of time having to
    experiment/research this further.

    Just to clarify - none of the bundles (or the app) are using GC so it'll be
    an ARC app loading manual RR code.
    David - always worth pointing out the memory management conventions, it'll
    be something I have to keep in mind when testing the ARC app for the first
    time.

    Cheers,

    On 18 May 2012 17:37, David Duncan <david.duncan...> wrote:

    > On May 18, 2012, at 7:39 AM, Patrick Robertson wrote:
    >
    >> I'm (finally) looking at converting my non-ARC (Mac OS X) app over to
    > ARC,
    >> but also have quite a few external plugins/bundles which can be loaded
    > into
    >> the main app on runtime.
    >> My question is - can my ARC app load non-ARC bundles, or is this not
    >> possible.
    >
    >
    > ARC code can load manual RR code (and vice versa). This property is relied
    > upon by the OS. The most important thing to cross compatibility is that
    > both sides understand and follow the Cocoa memory management conventions
    > (or annotated exceptions), as otherwise you can get over-retain and
    > over-release bugs at the boundaries.
    > --
    > David Duncan
    >
    >
previous month may 2012 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today