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
Timothy Holmes
1,617 PointsObj-C Handling HTML Entities in JSON Feed
I'm going through the tutorials and instead of using the treehouse blog to get a JSON feed I'm setting up our company website with the JSON API plugin. I got everything to work great but wordpress stores data with html entity coding, and the JSON plugins I've tried do not convert them.
This may be beyond the scope of iOS but how can you convert any html entities in a string using objective-c or by changing the php function (get_recent_summary) that outputs the JSON feed?
Here's a link to the feed: http://mindenair.net/main/?json=get_recent_summary&
1 Answer
Timothy Holmes
1,617 PointsWell...I found out that this was more difficult than I thought. I didn't find a solution server side that was easy enough for me because the JSON API plugin for wordpress just kept converting the character to html, and there's no built-in method to do this in objective-c. I did find a custom class and associated method here:
https://github.com/Koolistov/NSString-HTML
I put it in my app, imported the header file into TableViewController.m, and then called the method to convert each title string before they were displayed, and bang! Fixed!
Here's what it looks like now...

Timothy Holmes
1,617 PointsTimothy Holmes
1,617 PointsHere's a screenshot of what I'm talking about...