开发者

present a modal view from a modal view currently presented

I need to implement kind of a chain of modal view, in which a modal view is called from a modal view currently presented. I believe I have implemented everything right, but it开发者_运维知识库 crashes.

Is it a feasible idea?

this is how I'm calling the second modal view from the first modal view

hofButton = [[UIButton alloc] init];
hofButton.frame = CGRectMake(700.0, 450.0, 300.0, 200.0);
[hofButton addTarget:self action:@selector(showHOF:)
  forControlEvents:UIControlEventTouchUpInside];



-(void)showHof{
    modalHallOfFame = [[hallOfFame alloc] init];
modalHallOfFame.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:modalHallOfFame animated:YES];
}


I just did some quick testing. It seems to work just fine. If you posted the code that you use to present and dismiss the view controllers and the crash message you are getting that would help.


I figured out the problem. You actually can call a modal view from a modal view. What's wrong with my code above was that I had to declare showHof as -(void)showHOF:(id)sender{ ... }

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜