我怎么能从另一个viewcontroller的图标动作加载我的主ViewController的视图?

时间:2013-05-14 08:38:53

标签: iphone ios objective-c events viewcontroller

我有一个根ViewController类,并像这样调用OnlineViewController的View:

- (void)eventTap:(UIGestureRecognizer *)gestureRecognizer {

self.evc = [[EventViewController alloc]init];    
[self presentViewController:self.evc animated:YES completion:nil];

}

我尝试从OnlineViewController调用ViewController的视图,但它失败了:

-(void ) iconAction{
self.vc = [[ViewController alloc]init];

[self presentViewController:self.vc animated:YES completion:nil];

} 我怎样才能调用ViewController的视图?

1 个答案:

答案 0 :(得分:0)

尝试并解除此viewController而不是呈现新的

[self dismissViewControllerAnimated:YES completion:nil];

还要确保调用iconAction:方法。