开发者

Use presentModalViewController from a subView

开发者 https://www.devze.com 2023-03-29 01:16 出处:网络
I wanna use the presentModalViewController method from a subview, but it\'s not 开发者_JAVA百科working for me

I wanna use the presentModalViewController method from a subview, but it's not 开发者_JAVA百科working for me here is my code:

The subview:

-(IBAction) PressMoyensEs {
    MoyensEstimatifsViewController *MoyE = [[MoyensEstimatifsViewController alloc] initWithNibName:@"MoyensEstimatifsViewController" bundle:nil];
    [self.parentViewController presentModalViewController:MoyE animated:YES];
}


Have you checked your self.parentViewController? It's likely to be nil, as it is in many case, and thus your code is failing silently.

And, have you tried just [self presentModalViewController:MoyE animated:YES];? It's less 'correct', but if working, would already exclude some causes of failure.

0

精彩评论

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