xcode4.5 - Cocos2D Score Counter will not count score -


i making game in cocos2d. made score counter on screen, , when hit enemy adds point score. when run it, , when hit enemy project terminates.

it because of this: format specifies type 'id' argument has type 'int', referring line of code:

- (void)addpoint {  score = score + 1; // score++; work.  [scorelabel setstring:[nsstring stringwithformat:@"%@", score]]; } 

it says wants me replace @"%@" @"%d", because not make score work, please me fix this.

thank you!

yes, replace %@ %d. score integer, question has answer..why asked here?

 [scorelabel setstring:[nsstring stringwithformat:@"%d", score]]; 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -