Use presentModalViewController from a subView
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.
精彩评论