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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:11:48+00:00 2026-05-21T02:11:48+00:00

I wonder what the guidelines are for: 1 – how often I can read

  • 0

I wonder what the guidelines are for:
1 – how often I can read from NSUserDefaults
2 – how much data I can reasonably store in NSUserDefaults

Obviously, there are limits to how much NSUserDefaults can be used but I have trouble determining what’s reasonable and what isn’t.

Some examples among others:

  • If my game has an option for the computer to be one of the players, I will use NSUserDefaults to save that boolean value. That much is clear. But is it also reasonable to access NSUserDefaults during my game every time I want to know whether the computer is a player or should I be using an instance variable for that instead? Assume here I need to check that boolean every second. Is the answer the same is it’s 100 ms instead? What about every 10 s?

  • If my game has 50 moving objects and I want their positions and speeds to be stored when the user quits the app, is NSUserDefaults a reasonable place to store that data? What about 20 moving objects? What about 200?

  • 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-21T02:11:49+00:00Added an answer on May 21, 2026 at 2:11 am

    Don’t worry about limits. Instead, ask yourself this simple question:

    Is this a preference?

    If it is a preference, then it should be in user defaults. That’s what user defaults is for. If not, then it should be in the Documents directory (or, on the Mac, possibly in Application Support).

    On iOS, you might tell whether it’s a preference or not by whether it would be appropriate to (if possible) put it in your settings bundle for display and editing in the Settings application. On Mac OS X, you can usually tell whether it’s a preference or not by whether it would be appropriate to put it in the Preferences window.

    Of course, that relies on your judgment. Stanza for Mac, for example, gets it wrong, putting non-preferences in its Preferences window.

    You can also consider the question by its converse:

    Is this user-created data?

    A preference that you will have a default value for is not user-created data; it is user-overridden data. No less bad to lose it, but it informs where you should keep it.

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

Sidebar

Related Questions

I wonder whether there are some guidelines that I can use for coding Winform
I wonder if there is a way for me to SCP the file from
I wonder if there is any optimization I can do to achieve faster SELECTs
Wonder if you can help for Christmas. I am trying to read an XML
Wonder if anyone can help me understand how to sum up the column of
wonder whether someone can help me with the following one... I have a struct
I wonder if someone knows if there is a pre-made solution for this: I
wonder if someone can help me i know what i want to achive but
I wonder if anyone can help - I want to select a table and
I wonder if there is a way to query the XMPP server (passing user

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.