I tried archiving an NSAttributedString in Mac OSX 10.7 and then tried to unarchive it in iOS 4.. I get an error:
cannot decode object of class (NSParagraphStyle)
I see that there's no NSParagraphStyle in iOS. So my question is, is there a workaroun开发者_开发技巧d or is it not possible to this?
Perhaps you could use the NSKeyedUnarchiver
method setClass:forClassName
and provide a class of your own to use for NSParagraphStyle
. That class would have to implement initWithCoder:
and you could either ignore it or try to replicate NSParagraphStyle
with what's available on iOS (CTParagraphStyle
which is quite difficult to work with).
精彩评论