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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:19:11+00:00 2026-06-04T04:19:11+00:00

I have one application that sets preferences. It uses those prefs, and so does

  • 0

I have one application that sets preferences. It uses those prefs, and so does another application. When I use the following code in the second application, it reads the preferences correctly once.

    NSUserDefaults* settings = [NSUserDefaults standardUserDefaults];
    [settings addSuiteNamed:@"com.WVS.Wrestling-Tools"];
    [settings synchronize]; // this just a shot in the dark.. didn't work

    [self setScoreboardIndex:[settings integerForKey:@"matName"]];

On subsequent calls of the same code, I get the [settings integerForKey:@”matName”] is always the value that was first read.

In the first application, I’m using the Shared User Defaults Controller to read/write the preferences. Not sure if that matters to this issue or not.

How can I force the second application to always get the most recent values?

  • 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-04T04:19:13+00:00Added an answer on June 4, 2026 at 4:19 am

    You should be able to call +[NSUserDefaults resetStandardUserDefaults] in the second program to force +[NSUserDefaults standardUserDefaults] to create a new instance and reload values from disk the next time it’s called. Calling -synchronize in the first program is the correct approach to make sure the updated defaults are written to disk (I’m not sure how NSUserDefaultsController behaves in this regard).

    Note that calling +[NSUserDefaults resetStandardUserDefaults] every time you access the standardUserDefaults may result in a performance penalty if you do so frequently, since it will presumably mean a disk hit on every read.

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

Sidebar

Related Questions

I have one application that prints messages from Test.exe in console .My java program
The problem: we have one application that has a portion which is used by
We have one web application (sharepoint) that collects information from disparate sources. We would
I have one grails application.In that I have one model class named Book. From
I have created one application in flex that is accessing the Java webservice using
I have one form in a PHP (5.2.9-1) application that causes IIS (Microsoft-IIS/6.0) to
I have created one application in j2me, I have used json parsing in that
We have an application that has one or more text console windows that all
We have an application that generates simulated data for one of our services for
I have a web application that has one set of files used by 50+

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.