【发布时间】:2012-06-29 05:25:30
【问题描述】:
我正在尝试通过设备发送短信。但是上线就崩溃了
[self presentModalViewController:picker animated:YES];
代码:
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
picker.messageComposeDelegate = self;
picker.recipients = rec; // your recipient number or self for testing
picker.body = billInfo;
[self presentModalViewController:picker animated:YES];
[picker release];
错误日志:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target <billSummary: 0xfc7e780>.'
【问题讨论】:
-
您是否使用断点检查选择器是否为零。根据错误日志,它说明选择器为零以呈现模态视图,因此请找出选择器为零的原因
标签: iphone ios mfmailcomposeviewcontroller mfmessagecomposeview