• 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: Text Formatting (NSAttributedString?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Text Formatting (NSAttributedString?) (From: Jerry Brace <email@hidden>)

  • Prev by Date: Re: Does retain not work on ids?
  • Next by Date: Re: Does retain not work on ids?
  • Previous by thread: Text Formatting (NSAttributedString?)
  • Next by thread: Newbie: Chaining CIFilters together?
  • Index(es):
    • Date
    • Thread