Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Implementing Designs for iPhone Implementing Custom Login and Sign Up Screens Hiding the Navigation Bar

Alexander Teague
Alexander Teague
9,501 Points

Can't pass Implementing Design Code Challenge

The Question is to hide the nav bar in view did load iv typed the following which i believe to be correct however it won't pass, any ideas?

import "CodeChallengeViewController.h"

@implementation CodeChallengeViewController

  • (void)viewDidLoad { [super viewDidLoad];

    // Insert code here! [self.navigationController setNavigationBarHidden:YES]; }

  • (IBAction)dismiss:(id)sender {

}

@end

2 Answers

Please put your code in code blocks the formatting is difficult to read.

But I think I see the problem.

The Line:

// Insert code here! [self.navigationController setNavigationBarHidden:YES]; }

Should be:

// Insert code here! 
[self.navigationController setNavigationBarHidden:YES];}

The code you added was commented out by being on the same line as the "//" which indicates the rest that follows until the new line character should be ignored by the compiler because it is a comment on the code.

Alexander Teague
Alexander Teague
9,501 Points

Sorry thats my poor formatting of the post.

The problem turned out to be that the challenge was expecting

[self.navigationController.navigationBar setHidden:YES];