Does anyone know what made Apple leave out NSAttributedString when turning AppKit into UIKit?
The reason I ask is that I would really like to use it in my iPhone app
The answer above indicates that NSAttributedString is available on OS 4.0 and above, but per the documentation it's available on 3.2:
NSAttributedString Class Reference
Inherits from NSObject
Conforms to NSCoding, NSCopying, NSMutableCopying, NSObject (NSObject)
Framework /System/Library/Frameworks/Foundation.framework
Availability Available in iPhone OS 3.2 and later.
Companion guide Attributed String Programming Guide
Declared in NSAttributedString.h
Another approach would be to use a UIWebView with HTML. Or, if you are daring you can make use of the undocumented setHTML method on UITextView to set small snippets of formatted text...
To me this seems more like the future of where supporting formatted text will go, some way to leverage Webkit in outputting formatted strings.
I don't know if this is still relevant for you, but Joe Hewitt has published his three20 library in the meantime, which contains TTStyledText
and TTStyledTextLabel
to fit your needs.
I'm afraid you're going to have to roll your own. If you're getting bogged down when doing table drawing, I'd probably switch to raw Quartz calls; try and dump all your drawing into a single view, and do all your complex string drawing within it. NSAttributedString is handy, but I don't think it's using all that much special AppKit-mojo to get much better performance than straight string drawing calls.
The current from the documentation recommended way to do it is to use a UIWebView.
NSAttributedString is now on the iPhone as of 4.0 Beta