我正在尝试实现一个 SMS 应用程序。当我尝试发送短信时,我在 [self.navigationController presentModalViewController:picker animated:YES]; 处遇到异常。我对此很陌生。你们能帮帮我吗?我的代码如下。
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
picker.delegate = self;
picker.recipients = [NSArray arrayWithObject:@"123456789"]; // your recipient number or self for testing
picker.body = @"test from OS4";
[self.navigationController 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 <UINavigationController: 0x5b2c120>.
在此先感谢,S。