小编DLe*_*nde的帖子

Xcode 6 [NSString drawInRect:withAttributes:]

我已将我的XCode 5升级到6,但不幸的是,调试器突然停止或此时没有断点的异常.请参阅下面的图片了解更多详情.

在此输入图像描述

在此输入图像描述

这是我使用的示例代码,在以前的版本上运行很好.这有什么问题,我该怎么做才能避免这种异常?

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];
Run Code Online (Sandbox Code Playgroud)

xcode6.1.1

6
推荐指数
0
解决办法
149
查看次数

标签 统计

xcode6.1.1 ×1