UIView内でpresentViewControllerを使用しようとしています。
http://img145.imageshack.us/img145/6334/appt.png
上部/右側の「+」ボタンをクリックすると、右側(画像の灰色の部分)のテーブルビューをUIViewControllerに置き換えたいと思います。
- (void)add:(id)sender
{
UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"testview"];
[self presentViewController:controller animated:YES completion:NULL];
}
もちろん、これを行うことで、画面全体が置き換えられます..次のようなものが欲しいです:
[contentView addSubview:controller];
また
[contentView presentViewController:controller animated:YES completion:NULL];
contentView は、テーブルビューを含む UIView です
このaddChildViewControllerとpresentViewControllerを見つけましたが、それが私を助けることができるとは思いません
ありがとう
編集:
ストーリーボードで ContainerView を使用すると問題が解決しました