【问题标题】:Calling modalTransitionStyle from UITableViewController - nothing happens从 UITableViewController 调用 modalTransitionStyle - 没有任何反应
【发布时间】:2011-03-22 12:36:27
【问题描述】:

我终于设法修剪我的代码并将所有 TableViewController-Methods 放在一个单独的类中(远离我的 ViewController)。我有很多问题我已经解决了,但有一个让我感到困惑。

当表格中出现选择时,我之前加载了一个 modalViewController,它工作正常。但是现在,当我将所有表方法放在一个单独的类中时,模态视图根本不会加载。它调用该函数,并在我选择表格中的一行时很好地逐步执行它,但是我的 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];

}

有什么建议吗?

【问题讨论】:

    标签: ios uitableview presentmodalviewcontroller


    【解决方案1】:

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

    【讨论】:

    • taskViewController 不是 nil 并返回自身。在将所有东西放在一个单独的类中之前,我使用了完全相同的代码,所以它之前工作得很好。 UIModalPresentationFullScreen 没有帮助。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多