I am making an app that fetches JSON content of a blog. The titles of the blog articles are shown in tableView.
The titles fetched were HTML encoded. So I decoded them using this code
func configureCell(cell: UITableViewCell, atIndexPath indexPath: NSIndexPath) {
let object = self.fetchedResultsController.objectAtIndexPath(indexPath) as NSManagedObject
var encodedString = object.valueForKey("title")!.description
var encodedData = (encodedString as NSString).dataUsingEncoding(NSUTF8StringEncoding)
var attributedOptions = [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType]
var attributedString = NSAttributedString(data: encodedData, options: attributedOptions, documentAttributes: nil, error: nil)
var decodedString = attributedString.string
cell.textLabel?.text = decodedString
// cell.detailTextLabel?.text = object.valueForKey("publishedDate")!.description
}
I could accomplish the decoding and the titles are displayed in the simulator perfectly. But the console shows this error ThisIsMe[6837:2029906] +[CATransaction synchronize] called within transaction
4 times. There is no other error in the code and al other functions work well.
pls help
NSAttributedString
and HTML. – Orvilleorwell