2011-03-22 50 views
0

我终于设法修剪我的代码,并把所有TableViewController-Methods放在一个单独的类中(远离我的ViewController)。我有很多问题,我已经解决了,但有一个困惑我。从UITableViewController调用modalTransitionStyle - 什么也没有发生

当表中的选择发生时,我以前加载了一个modalViewController,它工作正常。但是现在,当我将所有Table-methods放在一个单独的类中时,模式视图根本不会加载。它调用这个函数,并且在我选择表格中的一行时很好地执行它,但是我的iPhone屏幕上没有加载视图?!

下面是代码:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 
TaskViewController *taskViewController = [[TaskViewController alloc] initWithNibName:@"TaskViewController" 
                       bundle:nil 
                       task:[listOfEntries objectAtIndex:indexPath.row]]; 
taskViewController.modalTransitionStyle = UIModalTransitionStylePartialCurl; 

[self presentModalViewController:taskViewController animated:YES]; 
[tableView deselectRowAtIndexPath:indexPath animated:NO]; 

}

有什么建议?

回答

0

加载NIB文件时出现问题?不从TaskViewController的init方法返回自我?你确定taskViewController不是零吗?也许你应该在父导航控制器上调用它?您是否将UIModalPresentationFullScreen设置为模式演示风格?

+0

taskViewController不为零并返回自身。在将所有的东西放在一个单独的类中之前,我使用了完全相同的代码,所以它工作得很好。 UIModalPresentationFullScreen不起作用。 – tamasgal 2011-03-22 13:08:16

相关问题