Hello everybody, I apologize if my question may result trivial or obscure. I am using a view presented modally. In order to achieve a little 'scenographic' animation effect, based on the value of a parameter, I wish to reach the following behavior:
If value is 0, the view presented modally stays on display and allows user actions until a back button is pressed (in which case the view is dismissed)
if value is 1, the view is presented modally, then it is dismissed immediately and an alert view appears above the calling view.
Now, I have tried to put the control on the value in the viewDidAppear method, within the modal view controller like this
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:YES];
if (<value> == 1) {
[self dismissModalViewControllerAnimated:YES];
}
}
And what I got is: If value is 0 the modal view stays on as planned
If value is 1 the modal view is dismissed as planned, but the application crashes immediately after. The debugger seems to suggest that the problem arose within
-[UIWindowController transitionViewDidComplete: fromView:toView]
And now the question(s): Am I trying to do something seriously illegal/impossible?
If a solution exists, it consists on just moving the control to another method? If yes, which method?
Or the solutions is far more complex?
Thank you