0

別のクラスからモーダルに提示する必要があるクラスにtableviewControllerがあります。modaltableviewクラスでは、viewDidLoadでtableviewを作成しています。これとは別に、このクラスにはtableViewデリゲートメソッドがあります。

私の質問は、このtableViewControllerをモーダルに表示するためにこのクラスオブジェクトをどのように提示するかです。私は次と同じクラスのviewControllerを提示しました:

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

しかし、別のクラスのviewControllerに何を書くべきでしょうか?このクラスまたはmodaltableViewControlerクラスからpresentModalViewControllerを呼び出しますか?

PS新しいmodalTableViewを提示する必要がある現在のviewControllerにすでにmodalViewControllerがあります。

よろしくお願いします。

4

1 に答える 1

0

表示されているViewControllerで、モーダルtableViewControllerのインスタンスを作成して初期化します。次に、表示されているView Controllerで、[self presentModalViewController:<THE TABLE VIEW CONTROLLER YOU JUST INITIALISED> animated:YES];

お役に立てれば!
-jrtc27

于 2010-07-05T11:46:45.093 に答える