【发布时间】:2013-04-22 16:00:09
【问题描述】:
-
如何通过
NSObject类方法在后台执行在任何视图控制器(topviewcontroller)上打开MFmessageComposeviewcontroller。这是我的代码,弹出按摩控制器没有错误
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到消息控制器)
【问题讨论】:
标签: ios iphone objective-c appdelegate mfmessagecomposeview