• 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 gains default font and paragraph style after round tripping through pasteboard?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSAttributedString gains default font and paragraph style after round tripping through pasteboard?


  • Subject: Re: NSAttributedString gains default font and paragraph style after round tripping through pasteboard?
  • From: Douglas Davidson <email@hidden>
  • Date: Mon, 12 Jun 2006 15:49:14 -0700


On Jun 11, 2006, at 4:00 PM, Jim Correia wrote:

I am creating an NSAttributedString which only has a link attribute with the hopes that when pasted it would pick up the typing attributes. However, after round tripping through RTFD it appears to have picked up the default font and paragraph style.

Is this the expected behavior? Is there any way I can put a string with a link on the pasteboard in such a way that it will pick up the typing attributes when pasted?


Not easily. Try this: create an NSTextView, populate it with your attributed string, and set the selection to cover the range of the link. Call -writablePasteboardTypes, and create a mutable copy of the resulting array. From it, remove NSRTFPboardType and NSRTFDPboardType (if present). Then call - writeSelectionToPasteboard:types: with the modified array as the types array.


Douglas Davidson

_______________________________________________
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


References: 
 >NSAttributedString gains default font and paragraph style after round tripping through pasteboard? (From: Jim Correia <email@hidden>)

  • Prev by Date: Re: Cocoa newb - Bus Error from TCP Server
  • Next by Date: Re: Apple Data Plotting Framework
  • Previous by thread: NSAttributedString gains default font and paragraph style after round tripping through pasteboard?
  • Next by thread: Decoding html entities
  • Index(es):
    • Date
    • Thread