Re: Difficulties with recovering NSAttributedString attachments from saved RTFD

2019-11-27 Thread Jeff Younker via Cocoa-dev
So, I replaced... *let* recoveredString = NSMutableAttributedString(rtfd: savedRtfd, documentAttributes: *nil*)! ...with... *let* fw = FileWrapper(serializedRepresentation: savedRtfd)! *let* filePath = URL(fileURLWithPath: "/tmp/bar") *do* { *try*

Re: Difficulties with recovering NSAttributedString attachments from saved RTFD

2019-11-27 Thread Gary L. Wade via Cocoa-dev
You want to use a file wrapper rather than data and specify the document type in the attributes as RTFD. -- Gary L. Wade http://www.garywade.com/ > On Nov 27, 2019, at 10:18 AM, Jeff Younker via Cocoa-dev > wrote: > > I am having some difficulty with saving

Difficulties with recovering NSAttributedString attachments from saved RTFD

2019-11-27 Thread Jeff Younker via Cocoa-dev
I am having some difficulty with saving NSAttributedStrings as RTFD and then recovering them with attachments intact. I generate a string containing an attachment and turn that into RTFD. When I turn that RTFD back into an NSAttributedString, I get the .string back, and I get an attachment, but