Login Process troubles in my App

Discussion in 'iOS Programming' started by jjanes, Apr 8, 2012.

  1. jjanes macrumors newbie

    Joined:
    Feb 28, 2011
    #1
    I am building an App that requires a token so am in a viewcontroller called ViewControllerTwo which has data fields in it pertaining to username and password I have a button that the user taps to validate. Using JSON I submit the information and get the response.

    As I said my current view is a ViewController
    The next view is a tabcontroller which does exist in my storyboard with and ID of 'paidContent'


    I now know that the information is either accepted or not by the existence of a token

    so if I do not have a token I get the user to change the login information in the view controller I am in

    If I have a token I want to move directly to the tabcontroller and proceed with the App functions allowed

    if (not token)
    get valid info
    else
    goto tabcontroller <----how do I do this



    I managed to create a generic segue and then call it with this code

    Code:
            if ([message isEqualToString: @"Successful login."]) {
                 NSLog(@"Yep");
                // UITabBarController *tabBarController = [self.storyboard instantiateViewControllerWithIdentifier:@"PaidContent"];
                [self performSegueWithIdentifier: @"toTabBar" sender: self];
    
    and it works almost flawlessly. I say almost because a new screen does appear.
    In the new tabbarcontroller I am trying to point to the default storyboard tabcontroller layout which has two tabs automatically set I set the background to yellow in the first tab and set an image in the second tab.

    When my new generic segue is performed as in the code shown above the view changes on my iphone but it shows the no tabbar elements and the image I placed in the second tab is being displayed but again no controls it is as if I am in a basic viewcontroller and as the supposed tabcontroller was built it was being built in the viewcontroller model and the last element to be placed when building the tabcontroller was the image of the second element and that is what is displayed.

    I am probably missing something very basic

    If someone could let me know what I am missing I would be thankful
     
  2. jjanes thread starter macrumors newbie

    Joined:
    Feb 28, 2011
    #2
    Resolved

    Not sure what happened but one of the child viewcontrollers had the same identifier set as the tab controller.

    Not sure how it happened but when I did a clean and rebuild it works as suspected
     

Share This Page