0
내 프로젝트를 Cocos2D v2.1에서 V3.0으로 변환하고 있습니다. 이것은 Cocos2D가 하위 프로젝트로 추가 된 UIKit 프로젝트이며, 감독은 몇 개의 뷰 컨트롤러에 느리게로드되었습니다. Cocos2D V3.0 crash CCLabelTTF
-[NSConcreteMutableAttributedString hasAttribute:]: unrecognized selector sent to instance 0xc4f8ff0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteMutableAttributedString hasAttribute:]: unrecognized selector sent to instance 0xc4f8ff0'
*** First throw call stack:
(
0 CoreFoundation 0x0291a1e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x026998e5 objc_exception_throw + 44
2 CoreFoundation 0x029b7243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x0290a50b ___forwarding___ + 1019
4 CoreFoundation 0x0290a0ee _CF_forwarding_prep_0 + 14
5 0x0019d7d0 -[CCLabelTTF updateTexture] + 544
6 0x0019d546 -[CCLabelTTF visit] + 70
7 0x00181c86 -[CCNode visit] + 566
8 0x00181c86 -[CCNode visit] + 566
9 0x00202b9d -[CCDirectorIOS drawScene] + 381
10 0x00203fdc -[CCDirectorDisplayLink mainLoop:] + 92
CCLabelTTF 기능 - (BOOL) updateTexture
의 중단 정지
#ifdef __CC_PLATFORM_IOS
// Font color
if (![formattedAttributedString hasAttribute:NSForegroundColorAttributeName])
코드에 하나의 CCLabelTTF이있다, 나는 그렇게처럼 만들 :
self.scoreLabel = [CCLabelTTF labelWithString:NSLocalizedString(@"Score", @"") fontName:@"Marker Felt" fontSize:20 dimensions:CGSizeMake(100, 50)];
self.scoreLabel.horizontalAlignment = (CCTextAlignment)NSTextAlignmentRight;
scoreLabel.position = ccp(250,70);
[self addChild:scoreLabel z:1];
많은 도움을 주셨습니다. Cocos2D 포럼을 검색했으며 여기에서이 문제와 비슷한 것을 찾을 수 없습니다.