Wie kann ich decode HTML entities werden in swift?

Bin ich ziehen eine JSON-Datei von einer Website und einer der strings empfangen ist:

The Weeknd ‘King Of The Fall’ [Video Premiere] | @TheWeeknd | #SoPhi 

Wie kann ich umwandeln Dinge wie &#8216 in die richtigen Zeichen?

Ich habe eine Xcode Spielplatz zu demonstrieren:

import UIKit

var error: NSError?
let blogUrl: NSURL = NSURL.URLWithString("http://sophisticatedignorance.net/api/get_recent_summary/")
let jsonData = NSData(contentsOfURL: blogUrl)

let dataDictionary = NSJSONSerialization.JSONObjectWithData(jsonData, options: nil, error: &error) as NSDictionary

var a = dataDictionary["posts"] as NSArray

println(a[0]["title"])

InformationsquelleAutor code_cookies | 2014-09-01

Schreibe einen Kommentar