我看过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];
}
调试器确认我收到了事件,但没有显示任何视图。该代码是正确的,因为我在其他应用程序中使用了完全相同的代码,而当时我还没有处于模态视图中。