Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTExtView




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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

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



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.