how to open
MFmessageComposeviewcontroller
on any view controller (topviewcontroller) fromNSObject
class method excute in background.This is my code which popup massage controller without error
MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init]; if([MFMessageComposeViewController canSendText]) { controller.body = @"Check out FundooSpace for mobile. Download it now from www.lsaknlansc.cas.kasjla/FundooSpace/d"; controller.recipients=(NSArray *)passa; passa=nil; AppDelegate *appDelegateObject1 = (AppDelegate *)[[UIApplication sharedApplication] delegate]; controller.messageComposeDelegate=self; [appDelegateObject1.navigationCntr.topViewController performSelectorOnMainThread:@selector(presentModalViewController:animated:) withObject:controller waitUntilDone:NO]; }
But 1 after send or cancel button clicked then it get crash.
2. The delegate
method is not called (how to set delegate to message controller)