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 trialSebastian Nitu
8,616 Pointsblog.teamtreehouse.com JSON problems...
It seems that the JSON data for the Blog reader tutorial is no longer properly formatted.
Apostrophe symbols are missing...
CC:@Amit Bijlani
1 Answer
Amit Bijlani
Treehouse Guest TeacherThat's actually a good thing because things like apostrophes always cause problems. This is the perfect example of having to scrub through third-party data to clean it up before displaying it. I would just convert the HTML character to an apostrophe.
You can create a method to perform the conversion (and add others as needed):
- (NSString*)htmlToText:(NSString*)htmlString {
htmlString = [htmlString stringByReplacingOccurrencesOfString:@"’" withString:@"'"];
htmlString = [htmlString stringByReplacingOccurrencesOfString:@""" withString:@""""];
return htmlString;
}