0

I'm working on a baseball game app that contains multiple Modal View Controllers. However, when I make the modal transition from "BasicGameSetupViewController" to "BasicViewController", the transition happens (because I have NSLog statements within my ViewDidLoad method in the BasicViewController), but the actual view does not update. Here is the method where I transition to the BasicViewController (this code is in BasicGameSetupViewController):

- (IBAction)pressedBeginPlay:(id)sender {
    numOfInnings = [selectInnings selectedSegmentIndex];
    numOfInnings = numOfInnings + 1;
    row = [teamSelector selectedRowInComponent:0];
    visitor = [teams objectAtIndex:row];
    row = [teamSelector selectedRowInComponent:1];
    home = [teams objectAtIndex:row];
    NSLog(@"%@", visitor);
    NSLog(@"%@", home);
    if([awaySelect selectedSegmentIndex] == 0)
    {
        awayPlayer = @"Human";
    }
    else
    {
        awayPlayer = @"CPU";
    }
    if([homeSelect selectedSegmentIndex] == 0)
    {
        homePlayer = @"Human";
    }
    else
    {
        homePlayer = @"CPU";
    }
    [self performSegueWithIdentifier:@"startBeginnerToBasic" sender:self];
}

(This block also has a "prepareForSegue" method) And here is the viewDidLoad method in BasicViewController:

- (void)viewDidLoad{
    NSLog(@"Made it to basic View controller");
    homeLineup = [[NSMutableArray alloc] initWithCapacity:9];
    visitorLineup = [[NSMutableArray alloc] initWithCapacity:9];
    batter = [[NSMutableArray alloc] initWithCapacity:22];
    homePitcher = [[NSMutableArray alloc] initWithCapacity:22];
    awayPitcher = [[NSMutableArray alloc] initWithCapacity:22];
    pitcher = [[NSMutableArray alloc] initWithCapacity:22];
    homeAlreadyPitched = [[NSMutableArray alloc]initWithCapacity:5];
    awayAlreadyPitched = [[NSMutableArray alloc] initWithCapacity:5];
    NSLog(@"arrays initialized");
    [super viewDidLoad];
    [self setUpTeams];
    [self checkForComputer];
    [self newBatter];
    [self atBat];
    // Do any additional setup after loading the view.
}

I'm completely stumped as to why my view isn't showing. The NSLog statements that are in the ViewDidLoad code block above show up, but the I can't get the view to show. Does anyone have any ideas? Thank you in advance for your help!

LuisCien
  • 6,362
  • 4
  • 34
  • 42
  • What were you expecting to see and what are you actually seeing? – LuisCien Oct 25 '13 at 18:33
  • This is not the answer you want but here is and advice: You should usually call [super viewDidLoad] as early as possible. Otherwise, the superclass may interfere with your own implementation. http://stackoverflow.com/questions/6033668/does-it-make-a-difference-where-to-put-super-viewdidload-in-my-uiviewcontrolle – Goca Oct 25 '13 at 23:11
  • @MoisesCardenas, I did have the [super viewDidLoad] at the top of the [viewDidLoad] method, but it was still doing the same thing... – Josiah Nusbaum Oct 26 '13 at 19:06
  • @LuisCien, I'm expecting to see the view for the BasicViewController (which I created in the storyboard), but I'm seeing the BasicGameSetupViewController that I designed in the storyboard. I originally thought it was locking up, but I put NSLog statements in the BasicViewController that are displaying, so it's definitely getting to the BasicViewController – Josiah Nusbaum Oct 26 '13 at 19:08

0 Answers0