Is it possible to somehow handle the non-arc files without adding fno-objc-arc
to the compile sources in the build phases? More specifically, is there any way to add fno-objc-arc
somewhere in the code? The reason is, I want to open source one of my library which uses non-arc files and I don't want people who use my library to manually add fno-objc-arc
. Just drag and drop...
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
No. But if you look at what some libraries do, they write macros that will conditionally call the MRC calls, e.g.,
release
,autorelease
, etc., depending upon whether the user is compiling with ARC or not, e.g. using the__has_feature(objc_arc)
test. The code then uses these macros, rather than the standardrelease
,retain
,autorelease
calls. With careful implementation, you can then have a single codebase support both ARC and MRC.For example, look at
FMDatabase.h
of the FMDB library. Effectively, you replace your MRC calls with these macros, and they'll only be conditionally included, depending upon whether the project is using ARC or not.