Cocos2d iphone CCLabelBMFont CoCoCos2D类的initWithString引发NSInternalInconsistencyException异常

Cocos2d iphone CCLabelBMFont CoCoCos2D类的initWithString引发NSInternalInconsistencyException异常,cocos2d-iphone,cocos3d,Cocos2d Iphone,Cocos3d,以这种方式实例化CCLabelBMFont _targetDistanceBM =[[CCLabelBMFont alloc] initWithString:@"" fntFile:@"font.fnt"] 原因异常“由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“TextureCache:fileimage不能为零” 根据许多帖子的说法,这似乎是创建它的方式 字体文件是使用联机工具创建的 我正在使用COCOS2D版本3,它是C

以这种方式实例化CCLabelBMFont

   _targetDistanceBM =[[CCLabelBMFont alloc] initWithString:@"" fntFile:@"font.fnt"]
原因异常“由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“TextureCache:fileimage不能为零”

根据许多帖子的说法,这似乎是创建它的方式

字体文件是使用联机工具创建的


我正在使用COCOS2D版本3,它是COCOS3D附带的。

COCO2D只支持文本格式的fnt文件。此外,相应的png文件必须与fnt文件放在同一文件夹中