从声明视图控制器设置委托?

时间:2014-01-14 14:32:54

标签: ios iphone objective-c delegates

我需要设置我的委托,但不能看到我的能力,或者至少目前没有取得成功。这就是我的故事板的样子:

  

ViewController 1>模态演示> NavigationController>   ViewController 2> ViewController 3

我在ViewController 3中声明了我的委托/协议。我需要ViewController 1来使用这个委托。这样我就可以将消息从3发送回1。

我的问题:如何设置代理?我在ViewController 3中尝试了下面的代码而没有运气。

ViewController1 *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"EquipmentVC"];
    delegate = vc;

1 个答案:

答案 0 :(得分:0)

为什么不让导航控制器呈现视图控制器?

类似的东西:

delegate = self.navigationController.presentingViewController;
相关问题