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 Build a Diary App Using Core Data Custom UITableViewCell UIAppearance to Customize the Navigation Bar

UIAppearance Navigation Bar - Clearing Doubts

Okay, gentleman in this thread confused me. But, I tried various combinations on XCode and came out with a new question - Why is Method 2 not being accepted?

// Method 1: Treehouse accepted this answer
appearance.tintColor = [UIColor whiteColor];

// Method 2: Treehouse did not accept this answer - Why?
[appearance setTintColor:[UIColor whiteColor]];

Since, appearance is not being used as a property, these two commands will not work on Treehouse (but effective in XCode) -

// Method 3
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];

// Method 4 
[UIBarButtonItem appearance].tintColor = [UIColor whiteColor];

2 Answers

Guillaume Maka
PLUS
Guillaume Maka
Courses Plus Student 10,224 Points

Hi,

I think it's just the way how the team at treehouse develop the code challenge acceptance test, they can't enumerate all correct answers (because everyone has it own answer) but to avoid this problem they could be more descriptive in the code challenge question, maybe give some hint for the syntax (short|long|as describe in the video...) to use.

If a staff member read this thread, he can share more details how works the code challenge engine.

Best Regards.

Guillaume Maka
Guillaume Maka
Courses Plus Student 10,224 Points

Oh and last thing don't stop when you get an error, try to figure out if the code can be write in different way and test it in real (ex: for iOS => Xcode) if you obtain the expected result, it means you are on the good way !!!

Agreed. By the way, the solution provided by you in this thread is incorrect. Best Answer was misleading for me, spent more time trying those commands :(

Furthermore, after playing with the compiler I realized even a single space makes a difference :)

Guillaume Maka
PLUS
Guillaume Maka
Courses Plus Student 10,224 Points

Which one are incorrect for you and for what plateforme; xcode or treehouse ?

Incorrect in context to Treehouse. Perfectly, working in XCode. You used Method-3 as stated above. No big deal, it certainly does the job :)