我有一个根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的视图?
答案 0 :(得分:0)
尝试并解除此viewController而不是呈现新的
[self dismissViewControllerAnimated:YES completion:nil];
还要确保调用iconAction:
方法。