我看过SO而无法找到答案。我正在提出一个模态视图:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
ICObservationEditController *controller = [[ICObservationEditController alloc] initWithObservation:[self.observations objectAtIndex:indexPath.row]];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller];
navController.navigationBar.barStyle = UIBarStyleBlackOpaque;
navController.navigationBar.tintColor = [UIColor grayColor];
[self.editController presentModalViewController:navController animated:YES];
}
一旦提出,作为一个选项,我想在MessageUI
框架的顶部显示一条短信:
MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
if([MFMessageComposeViewController canSendText]) {
NSLog(@"presented");
//code here for text body
controller.recipients = [NSArray arrayWithObjects:@"", nil];
controller.messageComposeDelegate = self;
[self.editController presentModalViewController:controller animated:YES];
}
调试器确认我收到了该事件,但没有显示任何视图。代码是正确的,因为我已经在其他应用程序中使用完全相同的代码,但尚未处于模态视图中。