开发者

unarchiving NSAttributedString in iOS

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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜