Possible Duplicate:
Measuring the pixel width of a string in Objective C
I use the [string drawInRect:] methods, and would like the string to be truncated to the maximum length that would fit in that size. It's not as simple as finding out how many characters there are per line, as every letter is a different width. The reason I want to find where the string is no longer visible is so I can add elipses onto the end of the string.