错误:" - [NSCFString sizeWithTextStyle:]:IPhone SDK中无法识别的选择器"

Par*_*att 16 iphone cocoa-touch objective-c ios4

运行我的应用程序时出现以下错误.

' - [NSCFString sizeWithTextStyle:]:无法识别的选择器

我没有在整个项目中使用sizeWithTextStyle.

那可能是什么错?

我在return pos;下面的陈述中得到错误

码:

(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
     UIView *pos = [[UIView alloc] initWithFrame:CGRectMake(0.0,0.0,320.0,35.0)];
     return pos;
}
Run Code Online (Sandbox Code Playgroud)

控制台出错:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString sizeWithTextStyle:]: unrecognized selector sent to instance 0x7044b50'

由于在整个崩溃日志中存在缩进问题,我将放置崩溃日志的屏幕截图

在此输入图像描述

iHS*_*iHS 29

我认为,问题出在其他地方,不在这行代码中.该对象无法保留自己.发布您使用该sizeWithTextStyle方法的代码

你的链接设置上有-all_load标志吗?

这个问题出现了很多.您需要将-all_load和-ObjC添加到应用程序链接标志中.

*编辑:*

崩溃似乎在线发生:

 CGSize textSize = [self.text sizeWithTextStyle:textStyle];
 in class: CPTextLayer method: sizeToFit

 which is called from within class CPTextLayer method initWithText:
-(id)initWithText:(NSString *)newText style:(CPTextStyle *)newStyle
....
[self sizeToFit];


**try to set with iOS 4 and not with 3.1.3 **
Run Code Online (Sandbox Code Playgroud)