Xcode 6 [NSString drawInRect: withAttributes:]

I upgraded my Xcode 5 to 6, but unfortunately the debugger suddenly stopped or became an exception at this point without a breakpoint. See below for more details.

enter image description here

enter image description here

This is an example of the code that I use, it works in the previous version. Something is wrong with this, what should I do to avoid such an 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]; 
+6
source share

Source: https://habr.com/ru/post/982817/


All Articles