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 712673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:52:26+00:00 2026-05-14T04:52:26+00:00

I have issues with NSUserDefaults and I don’t quite understand what is going on.

  • 0

I have issues with NSUserDefaults and I don’t quite understand what is going on.

My App has 5 levels and each level does the exact same thing with NSUserDefaults (Retrieves the levels defaults, changes the value as the user plays the level and then sets the defaults and syncronizes at the end of the level) the first 4 levels. Work without a hitch but the last level doesn’t save the values. The app doesn’t crash and the last level isn’t the very last thing that happens, And I even have the defaults synchronized when the application terminates. Is there a max size on the NSUserDefaults or is there anything anyone can think of that I haven’t, I’ll post the code below but like I said the first four levels work perfectly

//header
NSUserDefaults *userData;


@property(nonatomic,retain) NSUserDefaults *userData;


//class file
//Sets the boolean variables for the class to use
userData = [NSUserDefaults standardUserDefaults];
boolOne = [userData boolForKey:@"LevelFiveBoolOne"];
boolTwo = [userData boolForKey:@"LevelFiveBoolTwo"];
boolThree = [userData boolForKey:@"LevelFiveBoolThree"];
boolFour = [userData boolForKey:@"LevelFiveBoolFour"];
boolFive = [userData boolForKey:@"LevelFiveBoolFive"];
boolSix = [userData boolForKey:@"LevelFiveBoolSix"];
boolSeven = [userData boolForKey:@"LevelFiveBoolSeven"];

//End Of Level
[userData setBool:boolOne forKey:@"LevelFiveBoolOne"];
[userData setBool:boolTwo forKey:@"LevelFiveBoolTwo"];
[userData setBool:boolThree forKey:@"LevelFiveBoolThree"];
[userData setBool:boolFour forKey:@"LevelFiveBoolFour"];
[userData setBool:boolFive forKey:@"LevelFiveBoolFive"];
[userData setBool:boolSix forKey:@"LevelFiveBoolSix"];
[userData setBool:boolSeven forKey:@"LevelFiveBoolSeven"];
[userData synchronize];

When when I switch to the view that uses these defaults they values are correct but when I terminate the application and restart it, these values aren’t saved, every other level does the exact same process this is the only level that doesn’t work.

I’ve stared at this for quite awhile and I’m hoping someone out there has run into the same problem and can give me some insight on how they resolved it.

  • 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-05-14T04:52:26+00:00Added an answer on May 14, 2026 at 4:52 am

    NSUserDefaults might not have a chance to save depending on how the process is terminated.

    This answer has more info: Why is NSUserDefaults not saving my values?

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

Sidebar

Related Questions

I have issues running grails using grails > run-app If I change a controller
We have issues within an application using a state machine. The application is implemented
I currently have issues in Webkit(Safari and Chrome) were I try to load dynamically
I sometimes have issues with the incremental rebuild on visual C++ (2003 currently ).
What compatibility issues have you found when developing with Visual FoxPro 9 on Windows
We have had issues with Mootools not being very backward compatible specifically in the
We have some issues in our application with skype taking over some of our
I have two issues both related to (I believe) my SQL Server setup. I
I have some issues with a PHP file that is not working properly. The
I'm have some issues adding a class to 2 navigation links on a theme.

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.