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 trialBenjamin Dirgo
2,215 PointsCapitalization challenge isn't working?
I have put this code into Xcode and it compiled and capitalized fine, but the web interface for this quiz is not accepting it as correct. There's nothing in the previous video about what method I should use, so I looked this one (capitalizedStringWithLocale) up in the documentation for NSString.
NSArray *booksArray = [[NSArray alloc] initWithObjects:@"hamlet",@"king lear",@"othello",@"macbeth",nil];
NSString *bookTitle = booksArray[2];
bookTitle = [bookTitle capitalizedStringWithLocale:[NSLocale currentLocale]];
NSLog(@"%@",bookTitle);
I'm not sure what they are looking for, Thanks!
1 Answer
Chase Snow
32,932 PointsYou could Append upercaseString to the end of you string variable Example:
NSString *bookTitle = [[booksArray objectAtIndex:2] uppercaseString];
Benjamin Dirgo
2,215 PointsBenjamin Dirgo
2,215 PointsThat worked! Thanks =]