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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:09:19+00:00 2026-06-01T07:09:19+00:00

Might be a stupid question but in our iOS app we’re storing an integer

  • 0

Might be a stupid question but in our iOS app we’re storing an integer for a UI color preference. In drawRect of a custom view, we’re currently getting that preference value and using it to set a particular UIColor for some text that is drawn.

I understand that standardUserDefaults values are cached, but is this an inefficient way of doing things? Should we instead add a local ivar to the custom view and pull the preference value on init and then register for a notification when defaults are changed, so the value can be updated?

  • 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-01T07:09:21+00:00Added an answer on June 1, 2026 at 7:09 am

    As noted here: Accessing NSUserDefaults Often, unless you are optimizing an inner loop that is called a million times per second, you don’t need to worry about this at all.

    Also it’s probably a bad idea to ask yourself such questions, that’s called premature optimization and we all know that it’s the root of all evil. If you want to know real answers, put all the code in the correct context (so you basically need to have the whole application finished) and use the profiler. In most cases you will see that the bottleneck is where you wouldn’t expect it.

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

Sidebar

Related Questions

This might be a stupid question, but how to set the color property of
its might be stupid question to ask here..but Our requirement is window azure application
might be a stupid question but I seem to be confused. Im pretty new
This might be a stupid question but if there's a better or proper way
This might be a stupid question but I just wanted to make sure... If
This might be a stupid question but I'm new at all this. I want
This might be a stupid question but I'll ask anyway, I was reading OOP
This might be a stupid question, but I can't for the life of me
This might be a stupid question, but I was wondering whether or not you
I'm new to WPF and therefore this might be a stupid question, but I

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.