drawInRect:withFont:lineBreakMode:alignment is deprecated
CGRect myRect = CGRectMake(5,10,200,100)
将
[myText drawInRect:myRect withFont:myFont lineBreakMode:UILineBreakModeWordWrap alignment:UITextAlignmentRight];
改写成:
NSMutableParagraphStyle *textStyle = [[NSMutableParagraphStyle defaultParagraphStyle]mutableCopy];
textStyle.lineBreakMode = NSLineBreakByWordWrapping;
textStyle.alignment = NSTextAlignmentRight;
NSDictionary *dictionary = @{NSFontAttributeName: self.percentageFont,NSParagraphStyleAttributeName: textStyle};