• 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: NSString sizeWithAttributes inaccuracy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString sizeWithAttributes inaccuracy


  • Subject: Re: NSString sizeWithAttributes inaccuracy
  • From: Manfred Schwind <email@hidden>
  • Date: Fri, 25 Jul 2008 11:19:29 +0200

he problem is that on very large strings sizeWithAttributes comes up short [no pun intended]

How much too short? Is it less than 1 pixel?

			float tiw = [self stringPixelWidth:[records objectAtIndex:i]];
			if(tiw > maxWidth){
				maxWidth = tiw;
			}
[...]
		[[[myTableView tableColumns] objectAtIndex:0] setWidth:maxWidth];

I think table columns are expected to have integer widths, so you have to round up to the next integer, e.g. like that:


[[[myTableView tableColumns] objectAtIndex:0] setWidth:ceilf(maxWidth)];

Mani
--
http://mani.de - friendly software
iVolume - listen to music freehand
LittleSecrets - the encrypted notepad



_______________________________________________

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSString sizeWithAttributes inaccuracy
      • From: Jacob Ole Juul Kolding <email@hidden>
References: 
 >NSString sizeWithAttributes inaccuracy (From: Jacob Ole Juul Kolding <email@hidden>)

  • Prev by Date: Re: Folder has limited permissions.
  • Next by Date: Re: Drawing a drop-shadow around a view
  • Previous by thread: Re: NSString sizeWithAttributes inaccuracy
  • Next by thread: Re: NSString sizeWithAttributes inaccuracy
  • Index(es):
    • Date
    • Thread