camdez.com

Rule #1: There are no rules.

iOS: Maintaining Compatibility While Leveraging New Frameworks

| Comments

If you starting using a framework that didn’t exist in a previous version of iOS, you’ll get dynamic linker errors when attempting to run your application on older devices. For example:

1
2
3
dyld: Library not loaded: /System/Library/Frameworks/EventKit.framework/EventKit
  Referenced from: /Volumes/(...)
  Reason: image not found

To fix this you need to modify your application so that the framework is weak-linked, meaning that the application will continue to run even if linking fails.

Right click your target in Xcode, choose Get Info. In the Linked Libraries section of the General tab, find the framework in question and change the value under Type from Required to Weak. Build and go!

Comments