0

我在一个类中有一个 tableviewController,我需要从另一个类中以模态方式呈现。在 modaltableview 类中,我在 viewDidLoad 中创建 tableview,除此之外,该类中还有 tableView 委托方法。

我的问题是如何呈现这个类对象以模态显示这个 tableViewController?我已经从同一个类中展示了 viewController:

  UIViewController *vw = [[UIViewController alloc]init];
  [self presentModalViewController:vw];

但是为另一个类的 viewController 写什么呢?我应该从此类或 modaltableViewControler 类中调用 presentModalViewController 吗?

PS 我在当前 viewController 上已经有一个 modalViewController,我必须在其中展示新的 modalTableView。

提前谢谢。

4

1 回答 1

0

在可见视图控制器中,创建并初始化模态 tableViewController 的实例。然后,仍然在可见视图控制器中,调用[self presentModalViewController:<THE TABLE VIEW CONTROLLER YOU JUST INITIALISED> animated:YES];

希望这可以帮助!
-jrtc27

于 2010-07-05T11:46:45.093 回答