0

I'm using a Page App. I have a viewController A and this have a scrollView with 3 others viewController lets call them ViewController B,C,D and I switch controllers B,C,D using scroller's paging. My problem is: I want to call presentModalViewController from a button in ViewController B but when I do this in ViewControllerB.m

-(void) nextController{
    ViewControllerE *controllerE = [[[ViewControllerE alloc] init]autorelease];
    controllerE.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    [self presentModalViewController:controllerE animated:YES];
}

It works and cover only B's view but I still can switch between E,C,D. I don't want this. I want to call this method from parent ViewController A, because when I call ViewController E, I want to make paging off.

I tried:

   [self.parentViewController presentModalViewController:controllerE animated:YES];

But didn't work.

Anyone can help me please?

4

1 回答 1

1

这是什么结果:

[self.parentViewController presentModalViewController:controllerE animated:YES];

它会给你一个错误 - 有什么事情发生吗?

尝试用这个调试:

NSLog(@"%@", self.parentViewController);

它给你什么结果?

于 2012-09-13T21:54:54.853 回答