Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void) theProblemMethod
- {
- dispatch_async(dispatch_get_main_queue(), ^{
- @try {
- [[self topViewController] dismissViewControllerAnimated:YES completion: ^{
- UIViewController * rootViewControler = nil;
- if ((rootViewControler = (UIViewController *) [UIApplication sharedApplication].keyWindow.rootViewController))
- {
- if([self topViewController])
- [(UINavigationController *)[self topViewController].navigationController popToViewController:rootViewControler animated:YES];
- if ((rootViewControler = (UIViewController *) [[[[UIApplication sharedApplication] delegate] window] rootViewController].presentedViewController)) {
- [rootViewControler dismissViewControllerAnimated:YES completion:
- ^{
- //do something here
- }];
- }
- }
- }];
- } @catch (NSException *exception) {
- NSLog(@"There is a problem at [myClass theProblemMethod] Exception: %@, reason: %@", [exception name], [exception reason]);
- } @finally {}
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement