After fixing a bunch of issues around using NSAttributedString and CCLabelTTF, one thing still is not working despite me trying to track down the issue.

Using NSAttributeString, you're supposed to be able to add images as NSTextAttachment and have them displayed inline with the text. This works fine with a UILabel, but something in the CT rendering breaks things for CCLabelTTF, so that NSTextAttachments are simply skipped (shown as spaces on iOS, placeholder [OBJECT] font glyphs on OS X).

It's as if image rendering is somehow getting disabled, but I can't find anything in the code that appears out of place.

Initially I suspected the various hacks done to the attributed string before display, but even feeding the draw routine the simplest possible attributed string (a string only containing the image attachment) fails to work.

Good luck wading through that code - hurts my head every time I need to look at it. For ages I've wanted to add clickable links to CCLabelTTF but run away each time I try and start, and use UIKIt hacks instead.

Silly check but have you got your NSAttributedString rendering ok in a UIKit view just to make sure it is all correctly configured? I've never used the NSTextAttachment but have had enough other rendering problems with attributed text to make me triple check everything first.

Turns out that attachments only work in iOS / OSX views. If you want to do it yourself in a graphics context you need to first render the text with spaces, then render the images in those spaces. This takes a lot of CoreText manipulation but works and is apparently the expected way of dealing with things.

A different path is taking an iOS/OSX text label and render it onto a CGContext. That method works if one wants to use NSTextAttachment.