开发者

unarchiving NSAttributedString in iOS

开发者 https://www.devze.com 2023-03-27 07:40 出处:网络
I tried archiving an NSAttributedString in Mac OSX 10.7 and then tried to unarchive it in iOS 4..I get an error:

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

精彩评论

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

关注公众号