views:

51

answers:

1

Hello all,

I'm in the process of turning one of my iPhone apps into a universal binary. Everything works ok accept for the MFMessageComposeViewController Class. I went the single project with two targets route.

When I run the iPad Target, the compiler flags the MFMessageComposeViewController. Obviously, this was introduced in 4.0 but the reference is in the iPhone Classes, not the iPad. Why is this and what am I missing?

Oh, and the MessageUI.framework is weak-linked in both Targets.

+2  A: 

You should build against the 4.0 SDK even when running on iPad. Just make sure not to reference the class.

Ben Gottlieb
Thanks very much, that removes the 43 errors. I must have changed it thinking it wouldn't need 4.0 but it makes sense now. It's my first universal project, still learning about multiple targets. Hopefully someone will find this helpful.
DysonApps
It's also probably a good idea to weak-link the MFMessageCompoer framework, by marking it as optional (if you want the iPhone part to also run on 3.0 devices which you might as well since you're supporting the iPad).
Kendall Helmstetter Gelner