我正在尝试运行最近完成的Xcode项目,我有一个错误要排序。非常感谢任何帮助....
错误之前出现语义问题 - 警告如下:
未声明的选择器'boundingRectWithSize:options:atrributes:context'
ARC语义问题错误如下:
'NSString'没有可见的@interface声明选择器'boundingRectWithSize:options:attributes:context:'
代码如下......
// Since sizeWithFont() method has been depreciated, boundingRectWithSize() method has been used for iOS 7.
if ([NSString instancesRespondToSelector:@selector(boundingRectWithSize:options:attributes:context:)]) {
NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
paragraphStyle.lineBreakMode = NSLineBreakByClipping;
CGRect requiredLabelRect = [self.textLabel.text boundingRectWithSize:contentViewSize
options:NSStringDrawingUsesLineFragmentOrigin
attributes:@{NSFontAttributeName:self.textLabel.font,
NSParagraphStyleAttributeName: paragraphStyle
}
context:nil];