• 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: NSTExtView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTExtView


  • Subject: Re: NSTExtView
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 23 May 2008 08:11:17 -0700


On 22 May '08, at 9:34 PM, email@hidden wrote:

I hope you could understand my question,

You didn't understand my answer, unfortunately. But at least you've finally posted enough information that I can see what's going on.


NSStrings don't have any formatting, of course, just plain characters.
When you initiaze your NSAttributedString using -initWithString:, all it gets is the plain characters of your text, not any of the formatting.
So what you have is an unformatted NSAttributedString. That's why you don't get any style tags. (You only get the <font> tags because AppKit assumes Helvetica is the default font.)


You need to create the attributed string in some way that won't lose all the formatting. What you probably want is to simply use the NSTextView's textStorage, which is an attributed string. Or if it's an NSTextField, call -attributedStringValue on it.

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

References: 
 >NSTExtView (From: email@hidden)
 >Re: NSTExtView (From: Jens Alfke <email@hidden>)
 >Re: NSTExtView (From: email@hidden)

  • Prev by Date: [OT] WWDC session schedule on your iPhone
  • Next by Date: Re: inter process NSView sharing
  • Previous by thread: Re: NSTExtView
  • Next by thread: NSTextField will not become editable in a borderless window
  • Index(es):
    • Date
    • Thread