0
votes

i am losing my mind !!

i have done this so many times and now its just not working !

in my init method i have this label :

teamLabel = [CCLabelTTF labelWithString:@"WAITING..." fontName:@"Marker Felt" fontSize:32];
        teamLabel.position = ccp( 150,100);
        teamLabel.color = ccc3(150, 50, 80);
        [self addChild:teamLabel];

        [teamLabel setVisible:YES];

then i call a function which i know it has been called(NSLOG) and there i am trying to print something in all kind of ways:

[teamLabel setString:@"ran"];
[teamLabel setString:[NSString stringWithFormat:@"%ig", (int) (ran)]]; //ran int==5;

the function is fired, but i can still see the first string from the init in my label without a change..

EDIT ::

it now prints a red big square which is in the size of my word. if the word is small i get small red square etc...

whats that ?!?

thanks .

1
are you sure that teamLabel is non-nil and visible?Magnus
i have set it to be visible as U see , and how can it be nil if at the start it actually works and i can see the word waiting..and then i set it with [teamLabel setString:@"ran"]; so what you mean by nil ?Curnelious

1 Answers

0
votes

I once came upon similar behavior, and it ended being due to lack of memory to allocate the TTF texture.

Perhaps you have been growing your game/app resource utilization and you are now seeing the same behavior.

Try disabling a number of these other resources, or create the TTF labels only. You can also try moving the creation of these TTFs out of the init method, to check whether there might be a load order/priority problem.

Cheers,