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
Ashley Kelley
Courses Plus Student 10,554 PointsConvert the 'futureDate' object to a string object named 'dateString'.
Hi,
So I've been waiting for the final chapters of the Blog Reader course and I seem to have forgotten some things. I'm struggling with the final code challenge and have tried various things. Can anyone please help? I know this is a really simple answer as well, but having gotten stuck I tried to copy the code from the tutorial video and I still can't manage it.
Thanks for helping.
Code:
NSString *futureDateString = [dateFormatter stringFromDate:dateString];
5 Answers
Amit Bijlani
Treehouse Guest TeacherAhh sorry missed the fact that you are trying to convert dateString. The method stringFromDate expects you to provide it a date which in this case is futureDate that you created previously. So your code should look like:
NSString *dateString = [dateFormatter stringFromDate:futureDate];
Amit Bijlani
Treehouse Guest TeacherYour code is right except the challenge is expecting you to create a string named dateString. So just rename futureDateString to dateString.
Ashley Kelley
Courses Plus Student 10,554 PointsIt's still comping up with a compilation error, Amit
NSString *dateString = [dateFormatter stringFromDate:dateString];
Ashley Kelley
Courses Plus Student 10,554 PointsBrilliant!
Thanks so much for your help, Amit, it's really appreciated.
Ashley
Stu Cowley
26,287 PointsYou're a true legend Amit Bijlani love your work!