iOS - 从容器视图推送Segue

时间:2014-05-30 19:14:16

标签: ios iphone objective-c delegates uicontainerview

我有一个容器视图。我想从容器的超级视图中推出segue(因为我无法从容器中推送segue),但是从容器视图中调用此调用。正确的策略是这样的委托模式吗?

MyViewController.h

@protocol ContainerDelegate <NSObject>

- (void)myViewController:(myViewController *)aMyViewController ShouldPerformSegueWithIdentifier:(NSString *)anIdentifier;

@end

然后在superview(包含视图)中,实现如下的委托方法:

- (void)myViewController:(myViewController *)aMyViewController ShouldPerformSegueWithIdentifier:(NSString *)anIdentifier
{
    [self performSegueWithIdentifier:anIdentifier sender:self];
}

0 个答案:

没有答案