• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSAttributedString: lossy attachments when serializing/archiving?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSAttributedString: lossy attachments when serializing/archiving?


  • Subject: Re: NSAttributedString: lossy attachments when serializing/archiving?
  • From: Jim Correia <email@hidden>
  • Date: Mon, 9 Jan 2006 20:11:53 -0500

On Jan 9, 2006, at 7:56 PM, Douglas Davidson wrote:

On Jan 9, 2006, at 4:47 PM, Jim Correia wrote:

Since in my application, the only time there will be an actually file backing the file wrapper is on the initial drag (since otherwise it is a serialized representation stored via CoreData), is it possible to force it to always use the "non-live" representation for the sake of consistency?


Yes--assign an NSTextAttachmentCell to the text attachment. For consistency, you can create it with an image representing an icon for the file type, obtainable from NSWorkspace. I would suggest assigning the cell to the attachment before it is displayed, so that the default cell will never end up being created.

Thanks. I'll give that a try.

A somewhat related question.

If I have a custom NSTextAttachmentCell subclass which does handles a particular file type:

Is this automatically used if I archive the attributed string with NSKeyedArchiver, then unarchive it?

For attributed strings which come from the filesystem or the pasteboard, I'll have to scan the string and replace the text attachment cell with my custom class?

Thanks,
Jim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSAttributedString: lossy attachments when serializing/archiving?
      • From: Douglas Davidson <email@hidden>
References: 
 >NSAttributedString: lossy attachments when serializing/archiving? (From: Jim Correia <email@hidden>)
 >Re: NSAttributedString: lossy attachments when serializing/archiving? (From: Jim Correia <email@hidden>)
 >Re: NSAttributedString: lossy attachments when serializing/archiving? (From: Douglas Davidson <email@hidden>)
 >Re: NSAttributedString: lossy attachments when serializing/archiving? (From: Jim Correia <email@hidden>)
 >Re: NSAttributedString: lossy attachments when serializing/archiving? (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: NSAttributedString: lossy attachments when serializing/archiving?
  • Next by Date: Re: NSAttributedString: lossy attachments when serializing/archiving?
  • Previous by thread: Re: NSAttributedString: lossy attachments when serializing/archiving?
  • Next by thread: Re: NSAttributedString: lossy attachments when serializing/archiving?
  • Index(es):
    • Date
    • Thread