Xcode 6 [NSString drawInRect: withAttributes:]

156 Views Asked by At

I've upgraded my XCode 5 to 6, but unfortunately debugger suddenly stop or an exception at this point without a breakpoint. Please see image below for more details.

enter image description here

enter image description here

This is the sample code I use, running on the previous version was fine. Is there something wrong with this, what should I do to avoid this kind of exception?

UIFont *font = [UIFont fontWithName:@"HelveticaNeue-Bold" size:20.0f];
NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;
paragraphStyle.alignment = NSTextAlignmentCenter;

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

[@"Hello" drawInRect:CGRectMake(118, 32, 375, 24) withAttributes:attributes];
0

There are 0 best solutions below