Le 8 nov. 2010 à 09:55, Micha Fuhrmann a écrit :

> But how can I compute the amount screen pixels my NSString that's going into 
> the cell will take to return a height with the proper number of lines? I must 
> be missing something, it's just too silly.

Assuming that "font" is a NSFont * ivar on the font your using, and 
stringLength the length of your NSString,

size = stringLength * [font maximumAdvancement].width;

will return you the largest size, in pixels, for a string of stringLength chars.

Vincent _______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to