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

Re: Testing NSLineBreakByTruncatingTail


  • Subject: Re: Testing NSLineBreakByTruncatingTail
  • From: Jim Correia <email@hidden>
  • Date: Mon, 5 Jan 2004 20:20:30 -0500

On Jan 5, 2004, at 8:14 PM, cricket wrote:

Is this documented anywhere? (I didn't see it in the release notes or the NSCell documentation.)

Is it possible to control which truncation method is used?

The truncation types are documented in the NSMutableParagraphStyle documentation for setLineBreakMode:

The code snippet I posted above is an addendum to the project Paul Fitzgerald posted to the list, which you can find at this URL:

There's a test project here: http://homepage.mac.com/pgfitzgerald

Just doing a setWraps:YES on the underlying cell is not enough to get truncation to work, it was just the missing piece that Paul needed to get his test project to work as expected.

I don't know if there is any documentation on the need for doing a setWraps:YES on the underlying cell to get truncation to work.

I guess I didn't read his sample code carefully at all. :-(

I thought there was some magic I was missing whereby NSCell did automatic truncation without going through attributed strings, but it appears there is no such magic feature.

To summary you need to use an attributed string with the appropriate line break mode -AND- send setWraps:YES to the cell (the later half being undocumented?).

Thanks,
Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Testing NSLineBreakByTruncatingTail (From: cricket <email@hidden>)
 >Re: Testing NSLineBreakByTruncatingTail (From: Jim Correia <email@hidden>)
 >Re: Testing NSLineBreakByTruncatingTail (From: cricket <email@hidden>)

  • Prev by Date: Re: Testing NSLineBreakByTruncatingTail
  • Next by Date: NSSpellServer & period
  • Previous by thread: Re: Testing NSLineBreakByTruncatingTail
  • Next by thread: Re: Testing NSLineBreakByTruncatingTail
  • Index(es):
    • Date
    • Thread