简体   繁体   中英

Using weak references in a static library

I am trying to build a static library which support a deployment target iOS 4.3 and above.

The problem is that my code uses weak references.

Is it anyway possible to only build the library which uses weak references?

There's this library from Plausible Labs that makes this work.

PLWeakCompatibility is a set of stubs that implement the Objective-C runtime functions the compiler uses to make __weak work. It automatically calls through to the real runtime functions if they're present (ie your app is running on iOS5+ or Mac OS X 10.7+) and uses its own implementation if they're not.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM