align text using drawInRect:withAttributes:
In the iOS 5 version of my app I had: [self.text drawInRect: stringRect withFont: [UIFont fontWithName: @"Courier" size: kCellFontSize] lineBreakMode: NSLineBreakByTruncatingTail alignment: NSTextAlignmentRight]; I'm upgrading for iOS 7. The above method is deprecated. I'm now using drawInRect:withAttributes: . The attributes parameter is an NSDictionary object. I can get drawInRect:withAttributes: to work for the former font parameter using this: UIFont *font = [UIFont fontWithName: @"Courier" size: kCellFontSize]; NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: font,