3

I have a message of deprecated method.

The line of code is this one :

[string drawInRect:drawArea withFont:uifont lineBreakMode:linebreaks[lineBreakMode] alignment:alignments[hAlignment]];

So I want to replace it with this code :

NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
paragraphStyle.lineBreakMode = NSLineBreakByTruncatingTail;
paragraphStyle.alignment = NSTextAlignmentCenter;

NSDictionary *attributes = @{ NSFontAttributeName: uifont,
                              NSParagraphStyleAttributeName: paragraphStyle};

[string drawInRect:drawArea withAttributes:attributes];

After this replacement, the warning is not here anymore. But, all my text is invisible. For example, I have a text "Options" which is not visible (but I can still click on it).

Someone can help on this please?

Regard

Niknolty
  • 93
  • 9
  • Have you tried changing contextRGB color for example following CGContextRef currentContext = UIGraphicsGetCurrentContext(); CGContextSetRGBFillColor(currentContext,0,0,0,1); – i.AsifNoor May 06 '14 at 07:10

0 Answers0