Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CCLabelTTF not working in iOS 6.1

I am using cocos2d v0.99.5 and iOS deployment target is 5.0

when i run my app with Xcode 5.0 in iOS-7.0/5.0 simulator it is working fine. and i run with Xcode 5.0 in iOS-6.1/6.0 simulator not working. i checked with breakpoint, it is crashing at the below code:

CCLabelTTF *mainGameTitle = [[CCLabelTTF alloc] initWithString:@"REGULAR PACK" dimensions:CGSizeMake(40, 50) alignment:UITextAlignmentLeft fontName:@"Arial Rounded MT Bold" fontSize:20];

and it shows like this:

enter image description here

When i write:

CCLOG(@"font names ====> %@",[UIFont familyNames]);

In this line also "EXC_BAD_ACCESS" error occur in iOS-6.0 and 6.1.

I tried with CCMenuItemFont, this one also shows the above crash.

it is Working in 7.0 and 5.0 simulator/device. What is this issue? please help me?

Edit:

I tried with another method i.e

 CCLabelTTF *mainGameTitle = [CCLabelTTF labelWithString:@"REGULAR PACK" fontName:@"Arial Rounded MT Bold" fontSize:20];

again i got same above UIFont issue in labelWithString:fontName:fontSize method.

like image 718
Hari Babu Avatar asked Oct 02 '22 06:10

Hari Babu


1 Answers

you use the CCLabelTTF method that is already Deprecated.see below screen shot

enter image description here

like image 103
Kirit Modi Avatar answered Oct 30 '22 02:10

Kirit Modi