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):
In your target parameters, simply set messageUI.framework to type 'weak'