• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Defaults not sync'ing?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Defaults not sync'ing?


  • Subject: Re: Defaults not sync'ing?
  • From: email@hidden
  • Date: Wed, 28 Dec 2005 22:37:22 -0800

Maybe call [defs synchronize] before pulling the prefs out in the other process?
Not just from the prefpane...

Just a guess...

Andre

Joachim wrote:

I have a system prefs pane which writes its settings to the defaults database using the code below. It then notifies another process about the change, but when that process reads the dictionary, it is the previous, cached, version that is being read.

NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
NSDictionary *prefs = [[NSDictionary alloc] initWithObjectsAndKeys:
Object-1, @"Key-1",
...
Object-n, @"Key-n",
nil];
[defs removePersistentDomainForName:bundleId];
[defs setPersistentDomain:prefs forName:bundleId];
[defs synchronize];

I've checked that the values are written correctly to the plist file and that the sequence of events is correct. What am I doing wrong?

I'm on Tiger, Xcode 2.2.

Thanks in advance,
Joachim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Defaults not sync'ing?
      • From: Joachim <email@hidden>
References: 
 >Defaults not sync'ing? (From: Joachim <email@hidden>)

  • Prev by Date: Re: Removing an object from an inverse (not deleting) does not remove from the other side?
  • Next by Date: Re: Defaults not sync'ing?
  • Previous by thread: Re: Spotlight
  • Next by thread: Re: Defaults not sync'ing?
  • Index(es):
    • Date
    • Thread