Re: NSString sizeWithAttributes inaccuracy
Re: NSString sizeWithAttributes inaccuracy
- Subject: Re: NSString sizeWithAttributes inaccuracy
- From: Jacob Ole Juul Kolding <email@hidden>
- Date: Fri, 25 Jul 2008 11:52:19 +0200
It's more than one pixel.
First time i noticed it was with a string of about 140 chars which gut
truncated about 10 chars.
Jacob Kolding
email@hidden
On Jul 25, 2008, at 11:19 AM, Manfred Schwind wrote:
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