This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the fact that alertView is retained here seems important -- does not reproduce otherwise. | |
self.alertView = [[UIAlertView alloc] initWithTitle: @"OK" message: @"OK" delegate: nil cancelButtonTitle: @"Cancel" otherButtonTitles: nil]; | |
[self.alertView show]; | |
// White the dialog is open, present a modal view controller. In a real-world scenario, this is actually | |
// occurring when the view controller is presented in response to alertView:clickedButtonAtIndex:, but | |
// for this example, we'll do it automatically. | |
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | |
UIViewController *controller = [[UIViewController alloc] initWithNibName: nil bundle: nil]; | |
controller.view = [[UIView alloc] initWithFrame: CGRectMake(0, 0, 320, 480)]; |