Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determining the pixel length of a string in Cocoa (MAC OSX)

I need to figure out the pixel length of an NSString in Cocoa on OSX and I have found a couple of links that describe how to do this using the IPhone sdk but I didn't see anything about how to do this when not targeting the IPhone. Can anyone link me to some docs that would be relevant. I did find anything in the NSString docs.

like image 910
Mike2012 Avatar asked Jan 11 '10 21:01

Mike2012


1 Answers

-[NSString sizeWithAttributes:]

like image 95
Chuck Avatar answered Oct 28 '22 13:10

Chuck