I have made a helper class for MFMessageComposeViewController so instead of view controller I have made my class with MFMessageComposeViewController as base class.
Now I am trying to present this Controller from my another controller named "ViewController B" on a button action. I am trying to pass the value from this controller to messageBody variable of MessageSSCont.h . The button action is like this :
self.messageController = [[MessageSSCont alloc]init];
self.messageController.messageBody = @"jfhjkhasfjhkwhfhdfjkjkfbhiehf";
[self presentViewController:self.messageController animated:YES completion:nil];
But unfortunately when the MFMessageComposeViewController is presented the value of messageBodyis null. Where I am doing wrong in this scenario. Why my variable is not getting passed to the MessageCont.hclass?
OK - you have subclassed
MFMessageComposeViewController, so you have its properties / methods available to your class.You don't need these in your
.hfile:You can call your custom
MFMessageComposeViewControllerlike this: