我在使用 Cocos2d 的 iOS 应用程序中遇到错误。这里是。
首先,我创建一个标签:
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)
谢谢!