Weak link framework
Asked Answered
O

2

7

Due to the last release of the adMob package, I have added the MessageUI framework to my project. As I wish to deploy my application to 2.x OS devices, I have weak linked MessageUI as advised.

If I build for iPhone device 3.0, it works fine.

If I build for iPhone device 2.2.1, I get a link error: "ld: framework not found MessageUI"

Where could I be wrong?

Ozonize answered 13/4, 2010 at 7:44 Comment(0)
C
4

You are getting that error because you are building against a version of the SDK that does not implemement the MessageUI framework.

What you need to do is to build for iPhone OS 3.0, but in the build settings for your target set the iPhone OS Deployment Target to iPhone OS 2.0 (or whatever minimum version you'd like to support with your final application). This way, you weak-link against the newer framework, but can still deploy the application to older devices.

Curriery answered 13/4, 2010 at 13:3 Comment(0)
C
13

This answer is missing important info - You also have to manually set the specific framework to link as "weak" instead of "required" :

in xcode - right click on the TARGET (!!!!) -> get info -> in the "General" tab, in the linked libraries list, you have a column on the right side titled "type".

The change needs to be performed there for frameworks that don't exist in previous versions of IOS.

Curmudgeon answered 25/11, 2010 at 15:58 Comment(1)
Hi Yoni, Thank you for answering. As I wrote in my question, I had already weaklinked MessageUI framework.Ozonize
C
4

You are getting that error because you are building against a version of the SDK that does not implemement the MessageUI framework.

What you need to do is to build for iPhone OS 3.0, but in the build settings for your target set the iPhone OS Deployment Target to iPhone OS 2.0 (or whatever minimum version you'd like to support with your final application). This way, you weak-link against the newer framework, but can still deploy the application to older devices.

Curriery answered 13/4, 2010 at 13:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.