Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5909] iOS: Convert codebase to ARC

GitHub Issuen/a
TypeEpic
PriorityHigh
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 1.7.3
Fix Version/sn/a
ComponentsiOS
LabelsARC
ReporterSindre Sorhus
AssigneeUnknown
Created2011-10-28T13:29:31.000+0000
Updated2018-10-03T11:08:20.000+0000

Description

Feature Request

It would be nice if we could convert Titanium Mobile codebase for iOS to use ARC. {quote} Automatic Reference Counting (ARC) for Objective-C makes memory management the job of the compiler. By enabling ARC with the new Apple LLVM compiler, you will never need to type retain or release again, dramatically simplifying the development process, while reducing crashes and memory leaks. The compiler has a complete understanding of your objects, and releases each object the instant it is no longer used, so apps run as fast as ever, with predictable, smooth performance. {quote}

Transitioning to ARC Release Notes

Automatic Reference Counting (ARC) is a compiler feature that provides automatic memory management of Objective-C objects. Rather than having to think about retain and release operations, ARC allows you to concentrate on the interesting code, the object graphs, and the relationships between objects in your application. !ARC_Illustration.jpg|thumbnail! Apple docs: [here](https://developer.apple.com/library/ios/releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html).

Attachments

FileDateSize
ARC_Illustration.jpg2015-09-25T22:31:44.000+000066021

Comments

  1. Ingo Muschenetz 2014-07-22

    Yes, valid. Though we need to scope it.
  2. Ingo Muschenetz 2014-07-22

    A quick scan suggests that there are hundreds of quick fixes to remove 'autorelease' and RELEASE_TO_NIL references. After that, there seem to be some issues that probably will take longer to test/fix, but nothing really hard stands out to me.
  3. Mark Mokryn 2014-07-23

    I'm guessing some JIRA issues will automagically be fixed once we update to ARC, and lots of future issues prevented. Well worth the effort.
  4. Neville Dastur 2014-07-24

    Can I just check that an assessment of impact on pre-existing 3rd party ios modules has been done. I don't know enough about the Ti build chain, but just wanted to make sure this had been thought about. Thanks
  5. Ingo Muschenetz 2014-07-24

    [~ndastur] Is your concern that a 3rd party module would need to be updated in order to continue working with a ARC-converted SDK?
  6. Neville Dastur 2014-07-24

    Yes. And support for various modules varies so it might have quite an impact. It might be that as modules are compiled into a static library it doesn't matter and xcode will happily link. I think the option to use arc or not occurs at the source build level
  7. Mark Mokryn 2014-07-24

  8. Mark Mokryn 2015-02-02

  9. Ivan Skugor 2015-02-23

    I guess not using ARC is not an option anymore :) https://developer.apple.com/news/?id=02202015a
  10. Tim Poulsen 2015-02-23

    The announcement from Apple pertains to Mac OS X apps, not iOS apps. Still, it probably indicates what Apple will require for iOS apps in the future. Thanks for making us aware of the new policy.
  11. Ivan Skugor 2015-02-23

    Whoops, you're right, I missed to notice that. And yeah, it's good indicate it'll come to iOS too. Cheers.
  12. Mark Mokryn 2015-02-23

    This should not be a difficult ticket, most of the changes are fairly mechanical to do. It will magically fix many existing bugs, I'm sure.... e.g. the example above with the nav buttons.

JSON Source