I have the following code which (supposedly) presents a subview when triggered by an action sheet button:
- (void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex
{
if (buttonIndex ==0) {
[self.view addSubview:self.customView];
//
// heavy lifting of method here
//
// self.customView removes itself from superview before actionSheet:dismissWithButtonIndex: finishes
}
}
After doing all the 'heavy lifting' the subview removes itself from the view heirachy (before the completion of the action sheet delegate method).
Alas!! I'm finding that the subview never gets shown on screen. Indeed, if I stop the added subview from dismissing itself and set breakpoints, I find that it is DOES get displayed, but only AFTER the UIActionSheet delegate method is completed.
Initially, I thought this was because the subview was being presented in the actionSheet:clickedButtonAtIndex:
UIActionSheet delegate method - causing the action sheet to block the presentation of the view.
Looking at other methods available, actionSheet:didDismissWithButtonIndex:
seemed like it might solve my problems as This method is invoked after the animation ends and the view is hidden
(per Apple Docs). Still no luck!
Any thoughts of how I might present this subview before the method is completed.