Re: NSString sizeWithAttributes inaccuracy
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