• 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: contracting strings with "..."
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: contracting strings with "..."


  • Subject: Re: contracting strings with "..."
  • From: Douglas Davidson <email@hidden>
  • Date: Mon, 1 Dec 2003 11:52:17 -0800

On Nov 30, 2003, at 7:52 PM, Francisco Tolmasky wrote:

Does anyone know of a subclass of nsstring that when drawn into an area that is smaller than its length it does the "..." thing. For example "abcdefghi" would become "abcd..." or maybe "ab...hi". I'm not sure what this behavior is called, but I've seen it done before and I seem to recall someone advertising it before.

This is often referred to as "truncation", and it is controlled by the line break mode of the paragraph style, e.g. NSLineBreakByTruncatingTail. The truncating modes are supported in Panther--see the release notes for details. You can probably find sample code fairly readily to reproduce this effect pre-Panther, but it is likely to be somewhat less efficient.

Douglas Davidson
_______________________________________________
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.

  • Prev by Date: Re: newbie memory question
  • Next by Date: Re: Retrieve changed text from undo manager?
  • Previous by thread: Re: rounding a float
  • Next by thread: Re: Retrieve changed text from undo manager?
  • Index(es):
    • Date
    • Thread