In order to support iPhone OS 3.x and 4.0 I programmatically control MFMessageComposeViewController functionality like this (use it only if the OS version is 4.0 or above):
Class theClass = NSClassFromString(@"MFMessageComposeViewController");
MFMessageComposeViewController *controller = theClass ? [[theClass alloc] init] : nil;
You can use the type MFMessageComposeViewController as in:
MFMessageComposeViewController *controller;
But you cannot use the global object MFMessageComposeViewController as in:
[MFMessageComposeViewController alloc];
Instead use the class lookup so you are not dependent on the linker:
[NSClassFromString(@"MFMessageComposeViewController") alloc];