Programming in objective-c: iOS Modal dialog via storyboard UITabBarController on newest questions tagged objective-c – Stack Overflow

storyboard

I’m looking to understand the “best” way to transition to UITabBarController D (the main interface in my application) from either A or B – conditionally going through C.

Meaning I’d like all of the following to be valid.

A -> C -> D
A -> B -> C -> D
A -> B -> D
A -> D

C is a modal dialog which basically asks the user for a piece of missing information if they don’t have it set in their profile.

I’ve tried:

  1. Using a triggered modal segue from D -> C in the viewDidLoad function of D:

    ([self performSegueWithIdentifier:@"ShowNumberDialog" sender:self];)
    
  2. Programatically displaying C as a modal on D in the viewDidLoad function:

    (void)viewDidLoad
    {
        [super viewDidLoad];
    
        NSString *deviceNumber = [[UserModel sharedSingleton] deviceNumber];
        if ([deviceNumber isEqual:[NSNull null]]) {
    
            UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
            UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"NumberDialog"];
            [vc setModalPresentationStyle:UIModalPresentationFullScreen];
    
            NSLog(@"Showing device number dialog");
           [self presentModalViewController:vc animated:NO];
        }
    }
    

Neither of these, plus uncountably other “hacky” attempts I’ve made seem to be working. So I assume I’m not understanding something fundamental about the way I’m supposed to do this. Can someone please recommend a better way?

See Answers


source: http://stackoverflow.com/questions/11819713/ios-modal-dialog-via-storyboard-uitabbarcontroller
Programming in objective-c: programming-in-objective-c



online applications demo