On 2/16/18 23:58, Quincey Morris wrote:
On Feb 16, 2018, at 14:13 , Markus Spoettl <ms_li...@shiftoption.com> wrote:

how can I go about decoding NSAttributedString

I just tried in a playground, and the problem is in NSParagraphStyle, not
NSAttributedString. It looks like it falls foul of the known secure coding 
issue about
decoding arrays of unknown type. (NSTextTab is the only class that lives in an 
array
within a paragraph style.)

That means NSParagraphStyle doesn’t actually conform to NSSecureCoding, and 
therefore
nor does NSAttributedString, when any non-default tabs are present. It’s not 
clear that
there’s an easy workaround. The only thing I can think of is to archive the 
text tabs
separately, and somehow re-install them on the relevant paragraph styles after
decoding, but that’s going to be a huge PITA in general.

Thanks Quincey, that's in fact a huge problem. Even if I find a way to write the thing so it can be read back, I still have old files to read that contain offending NSAttributedStrings.

The string is just a tiny part of my huge model, so I need a way to read it back, if need be without formatting. The one thing that it can't do is prevent me from reading files containing it.

Best Regards
Markus

--
__________________________________________
Markus Spoettl
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to