Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8144967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:30:56+00:00 2026-06-06T13:30:56+00:00

How will I go about this? I can show you some of my code.

  • 0

How will I go about this? I can show you some of my code. but basically Im guessing that I have to save the string or something . Any tips will be very appreciated. I want this to show up in another scene.

.h file

          int _score;
          int _oldScore;
        CCLabelTTF *_scoreLabel;
         @property (nonatomic, assign) CCLabelTTF *scoreLabel;

.m file

       _score = 0;
       _oldScore = -1;
     self.scoreLabel = [CCLabelTTF labelWithString:@"" dimensions:CGSizeMake(100, 50)               alignment:UITextAlignmentRight fontName:@"Marker Felt" fontSize:32];
     _scoreLabel.position = ccp(winSize.width - _scoreLabel.contentSize.width,      _scoreLabel.contentSize.height);
     _scoreLabel.color = ccc3(255,0,0);
     [self addChild:_scoreLabel z:1];


if (_score != _oldScore) {
    _oldScore = _score;
    [_scoreLabel setString:[NSString stringWithFormat:@"score%d", _score]];



}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T13:30:56+00:00Added an answer on June 6, 2026 at 1:30 pm

    I think the easiest thing is going to be to put it in the user defaults. E.g.

    // to write
    [[NSUserDefaults standardUserDefaults] setInteger:yourScore forKey:@"score"];
    [[NSUserDefaults standardUserDefaults] synchronize];
    
    // to read
    int score = [[NSUserDefaults standardUserDefaults] integerForKey:@"score"];
    

    There’s a slight cost to that because of the synchronize step, so don’t just do that instead of using normal internal storage, do it as well.

    The user defaults are meant to store the settings a user selects within an app. The have the slightly weird name because the assumption on the desktop way back when was that they’d be used to store the default properties that would be associated with a new document. You can store a variety of types of data to the user defaults, including NSStrings if you prefer.

    The standardUserDefaults are those just inherently provided by the OS. They’re per-app so you needn’t worry about naming conflicts.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering about this: I have a simple facebook-connect app that will only show
The criteria is basically this: folders will exist for about 24-48hrs folders names can
I have this action script code that is working perfectly but i am try
This is about a web app that serves images. Since the same request will
I have a question about how the google crawler (googlebot) will do in this
I'm about to start a new project. The purpose of this project will be
I don't know much about web development, so probably this question will sound exceptionally
I'm able to create html links the following way: <a href=/about>About Us</a> This will
We are building a REST service that will take about 5 minutes to execute.
I am trying to find a date picker that can show dates to select

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.