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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:26:31+00:00 2026-05-15T14:26:31+00:00

I am storing a username in CFPreferencesCopyAppValue. Under iOS 3.1.3 it works as expected

  • 0

I am storing a username in CFPreferencesCopyAppValue. Under iOS 3.1.3 it works as expected but in iOS4 it stores it while the App is open but as soon as its closed (using the multitasking close ability) the variable isn’t stored, ie on relaunch of the App its null.

I have a feeling it might be an issue with the multitasking as the App is closed a bit differently than in iOS 3 and therefore not saving on the App being closed.

I am unfortunately not using the most up to date version of the SDK so it might be fixed in later releases but I need the App to work under 3.1.3 and 4.0 and this is the last version of the SDK that has 3.1.3 and 4.0 without the need to have multiple installs. So if it is fixed on the final version I guess I have to have multiple installs.

Any light on the matter is appreciated.

  • 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-15T14:26:32+00:00Added an answer on May 15, 2026 at 2:26 pm

    It may be useful if you post some actual code of how you are trying to update the value. As per the CFPreferencesCopyAppValue documentation:

    Note that values returned from this function are immutable, even if you have recently set the value using a mutable object.

    And the Preferences Best Practices document specifies that you should be using CFPreferencesSetAppValue to save the value.

    Update: I suspect I am missing something in your scenario and maybe my answer below is what you’re doing, since you did mention that your current code works on 3.1.3.

    If that’s the case, you might want to specify on which event are you saving the value. It might be that you’re updating it when your app is being shut down, but if you have not explicitly specified in your plist you don’t support suspend, your app might just be suspended.

    Update2: The CFPreferencesSetAppValue documentation explicitly mentions:

    You must call the CFPreferencesAppSynchronize function in order for your changes to be saved to permanent storage

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

Sidebar

Related Questions

I am dealing with a single username and password in an App, I'm storing
I an using Session for storing UserName for whole project. But it always time
I have 2 tables - one storing user information (id, username, password) and the
I am storing a username/password in NSUserDefaults. I do not want this information to
What would you consider the proper way of storing a simple username string in
I've been asked to store password and username with usage of nsILoginManager . But
Is storing username & password of the user in a cookie a good practice?
As I'm uncomfortable storing my username and password (must auth to the proxy server
I am currently storing the username (email) and a salted hash of the email
What is a secure way of storing an a username and password (not asp.net

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.