• 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
What is the preferred way to set NSTextView content from NSAttributedString?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What is the preferred way to set NSTextView content from NSAttributedString?


  • Subject: What is the preferred way to set NSTextView content from NSAttributedString?
  • From: Jeff Younker via Cocoa-dev <email@hidden>
  • Date: Sun, 2 Feb 2020 11:31:33 -0800

Situation:

   - I am working in Swift 5.
   - I have an instance of an NSTextView. (Call it "V")
   - The value has already been set once. (Call this value "T1")
   - V is showing T1.
   - I have an NSAttributedString from another source. (Call this value
   "T2")

Desired goal:

   - I want to set the displayed contents of V to T2.

What is/are the recommended way/s to do this?

*I would hope that I could assign V.attributedString = T2, but alas the
world does not seem to be this simple.*

Thanks in advance.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Next by Date: RE: What is the preferred way to set NSTextView content from NSAttributedString?
  • Next by thread: Re: What is the preferred way to set NSTextView content from NSAttributedString?
  • Index(es):
    • Date
    • Thread