Bronze Challenge: Another Tab


Hello there!

I’m having some issues with the Bronze Challenge implementation specifically with the Tab Bar. My problem is when I launch the everything works correctly, I can change to Hypnotize, Reminder, and Quiz tab. If I try to change from Reminder to Hypnotize and back everything works correctly but when I tap over Quiz the tab bar stops working, I can still see it, but I can’t return to the other views.

I don’t get what I’m missing here… Any hint?

Here my QuizViewController code:

//  RTWQuizViewController.m
//  Quiz
//  Created by David Gómez on 2/24/14.
//  Copyright (c) 2014 RattleWare. All rights reserved.

#import "RTWQuizViewController.h"

@interface RTWQuizViewController ()

@property (nonatomic, assign) int currentQuestionIndex;

@property (nonatomic, copy) NSArray *questions;
@property (nonatomic, copy) NSArray *answers;

@property (nonatomic, weak) IBOutlet UILabel *questionLabel;
@property (nonatomic, weak) IBOutlet UILabel *answerLabel;


@implementation RTWQuizViewController

- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
    // Call the init method implemented by the superclass
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Get the tab bar item
        UITabBarItem *tbi = self.tabBarItem;
        tbi.title = @"Quiz";
        UIImage *icon = [UIImage imageNamed:@"Hypno.png"];
        tbi.image = icon;
        // Create two arrays filled with questions and answers
        // and make the pointers point to them
        self.questions = @[@"From what is cognac made?",
                           @"What is 7 + 7?",
                           @"What is the capital of Vermont"];
        self.answers = @[@"Grapes",
    // Return the address of the new object
    return self;

- (void)viewDidLoad
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    NSLog(@"RTWQuizViewController loaded its view");

- (IBAction)showQuestion:(UIButton *)sender {
    // Step to the next question
    // Am I past the last question?
    if (self.currentQuestionIndex == [self.questions count]) {
        // Go back to the first question
        self.currentQuestionIndex = 0;
    // Get the string at that index in the question array
    NSString *question = self.questions[self.currentQuestionIndex];
    // Display the string in the question label
    self.questionLabel.text  = question;
    // Reset the anwser label
    self.answerLabel.text = @"???";

- (IBAction)showAnswer:(UIButton *)sender {
    // What is the answer to the current question?
    NSString *answer = self.answers[self.currentQuestionIndex];
    // Display it in the answer label
    self.answerLabel.text = answer;


Here’s my application:didFinishLaunchingWithOptions: method:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    // Create the view controllers
    RTWHypnosisViewController *hvc = [[RTWHypnosisViewController alloc] init];
    RTWReminderViewController *rvc = [[RTWReminderViewController alloc] init];
    RTWQuizViewController *qvc = [[RTWQuizViewController alloc] init];
    UITabBarController *tabBarController = [[UITabBarController alloc] init];
    tabBarController.viewControllers = @[hvc, rvc, qvc];
    self.window.rootViewController = tabBarController;
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    return YES;



I was using a Window instead of a View to hold the elements in the QuizViewController.xib file.