Re: Text Formatting (NSAttributedString?)
Re: Text Formatting (NSAttributedString?)
- Subject: Re: Text Formatting (NSAttributedString?)
- From: Andy Lee <email@hidden>
- Date: Mon, 23 May 2005 22:07:56 -0400
On May 23, 2005, at 9:51 PM, Jerry Brace wrote:
I'm trying to format text content that I have in a NSTableView - or
any text string for that matter.
I need to be able to bold particular characters in the string.
In HTML it would be done like so:
"Monday<bold>Tuesday</bold>Wednesday<bold>Thursday"
I've been trying to find some good documentation on NSAttributedString
- I am thinking this is what I have to use.
Make sure you look at not only the Foundation docs on
NSAttributedString, but the AppKit extensions as well:
<file://localhost/Developer/Documentation/Cocoa/Reference/Foundation/
ObjC_classic/Classes/NSAttributedString.html>
<file://localhost/Developer/Documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSAttributedString.html>
The latter include some methods whose names begin with "initWithHTML",
which you could use to convert actual HTML, like in your example, to an
attributed string.
Also look at NSMutableAttributedString, which lets you modify
attributes of an existing string:
<file://localhost/Developer/Documentation/Cocoa/Reference/Foundation/
ObjC_classic/Classes/NSMutableAttributedString.html>
<file://localhost/Developer/Documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSMutableAttributedString.html>
--Andy
_______________________________________________
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