如何从后台的类方法执行中打开
MFmessageComposeviewcontroller
任何视图控制器(topviewcontroller) 。NSObject
这是我的代码,弹出按摩控制器没有错误
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]; }
但是 1 在单击发送或取消按钮后,它会崩溃。
2.delegate
方法没有被调用(如何设置delegate到消息控制器)