我在使用Cocos2d的iOS应用中遇到错误。在这里。
首先,我创建一个Label:
CCLabelTTF *_alertaGC;
...
...
_alertaGC = [CCLabelTTF labelWithString:@"" fontName:@"Marker Felt" fontSize:16];
_alertaGC.color = ccc3(0, 0, 0);
_alertaGC.position = [self convertiPad:ccp(110, 220)];
_alertaGC.anchorPoint = CGPointMake(0.5f, 0.5f);
[self addChild:_alertaGC z:100];
按下按钮,我更改了该标签的字符串:
...
_alertaGC.string = NSLocalizedString(@"LogFirst", @"Logueate primero");
...
但按下按钮时出现错误。它刚刚发生,因为我将Cocos2d从0.99更新到2.0rc ......所以我觉得有些东西已经改变,有些东西是错的。它必须是愚蠢的东西,但我不明白......
以下是日志:
2012-06-12 04:01:53.343 AwNoth[2286:707] *** Terminating app due to uncaught
exception 'NSInvalidArgumentException', reason:
'+[CCLabelTTF labelWithString:dimensions:fontName:fontSize:]: unrecognized selector
sent to class 0xff6ec'
*** First throw call stack:
(0x330f388f 0x35098259 0x330f692f 0x330f5915 0x33050650 0xb020f 0xae2ff 0x330521fb 0x39129 0x36649 0x34271 0x3304d3fd 0x80923 0x80fd1 0x7f569 0x3561492b 0x35614319 0x355fa695 0x355f9f3b 0x3319722b 0x330c7523 0x330c74c5 0x330c6313 0x330494a5 0x3304936d 0x33196439 0x35628cd5 0xa7c4b 0x2ef8)
terminate called throwing an exception(lldb)
谢谢!
答案 0 :(得分:0)
请注意,版本2.0rc现在被认为是不稳定的。我没有这个版本,但我建议你只需查看CCLabelTTF的源代码,看看如何声明类方法。