Question: I am drawing a `NSString` using `drawAtPoint` (`drawInRect`, that makes no big difference).
There is a parameter to set the line break mode, but has anyone an idea how to append "..." to strings if they are truncated?

One option is, to check whether the string is short enough. If that is not the case, iteratively remove the last character until the string length + 3 euqals the maximum length.

I am sure there is a better solution. Anyone an idea?

Best,

heinrich

Answer: 
You'd better to use another `NSString` method:

```
- (CGSize)drawAtPoint:(CGPoint)point 
             forWidth:(CGFloat)width 
             withFont:(UIFont *)font 
        lineBreakMode:(UILineBreakMode)lineBreakMode

```

And specify `UILineBreakModeTailTruncation` as `lineBreakMode`.
Updating answer since `drawAtPoint:forWidth:withFont:lineBreakMode:` has been deprecated since iOS 7.0. Instead, you can now use `drawInRect:withAttributes:`

`NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
paragraphStyle.lineBreakMode = NSLineBreakByTruncatingTail;
NSDictionary *textAttributes = @{NSFontAttributeName : [UIFont systemFontOfSize:20.0f],
 NSParagraphStyleAttributeName : paragraphStyle};
[text drawInRect:textRect withAttributes:textAttributes];`