Could i build a ARC framework and use it in a non-ARC project?

后端 未结 3 908
天命终不由人
天命终不由人 2020-12-15 11:38

I think the title explains my question pretty well, I\'m currently working on a small framework for my personal needs, and thought about building it with ARC (if thats possi

3条回答
  •  温柔的废话
    2020-12-15 12:25

    Yes, with one caveat: if you have iOS 4.x as a deployment target, a supplemental library is necessary to deal with ARC-compiled code on the older runtime. For an application built using ARC, this is packaged in with the application. This is not included if you are using an ARC-compiled library in a non-ARC application.

    You can manually link this library into your non-ARC application to avoid runtime problems on the older OS versions by adding -fobjc-arc to your Other Linker Flags for the application.

    See this Apple Developer Forums thread for some more discussion on this.

提交回复
热议问题