私のアプリのiOS 5バージョンでは、次のことがありました。
[self.text drawInRect: stringRect
withFont: [UIFont fontWithName: @"Courier" size: kCellFontSize]
lineBreakMode: NSLineBreakByTruncatingTail
alignment: NSTextAlignmentRight];
iOS 7 にアップグレードしています。上記の方法は非推奨です。私は現在drawInRect:withAttributes:を使用しています。attributesパラメータはNSDictionary オブジェクトです。これを使用して、 drawInRect:withAttributes:を以前のフォントパラメータで機能させることができます。
UIFont *font = [UIFont fontWithName: @"Courier" size: kCellFontSize];
NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: font, NSFontAttributeName,
nil];
[self.text drawInRect: stringRect
withAttributes: dictionary];
NSLineBreakByTruncatingTailとNSTextAlignmentRightを取得するために辞書に追加するキーと値のペアは何ですか?