• 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: Live updating user defaults from a prefpane to a running app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Live updating user defaults from a prefpane to a running app


  • Subject: Re: Live updating user defaults from a prefpane to a running app
  • From: Shamyl Zakariya <email@hidden>
  • Date: Wed, 14 Jul 2010 15:21:29 -0400

> Yes. The app that writes the pref should call synchronize and send its signal, then the app that reads calls synchronize when it receives it. I have a pair of apps that do that; I use NSDistributedNotificationCenter and the CF equivalent CFNotificationCenterGetDistributedCenter for the signals.

That sounds quite elegant, thanks!


--

shamyl zakariya
	- so much for pathos



On Jul 14, 2010, at 3:03 PM, Lee Ann Rucker wrote:

>
> On Jul 14, 2010, at 9:20 AM, Greg Guerin wrote:
>
>> Shamyl Zakariya wrote:
>>
>>
>>> If not, what's the best practice here? And if I were to use some
>>> sort of apple event fired from the prefpane or some other technique
>>> to let the app know its defaults have changed, how do I get the
>>> user defaults controller in the headless app to apply the updates?
>>
>>
>> If I understand the question correctly, then when the signal is
>> received, your headless app calls -synchronize on the
>> NSUserDefaults.  This assumes you don't have any shared-access
>> contention issues.
>
> Yes. The app that writes the pref should call synchronize and send its signal, then the app that reads calls synchronize when it receives it. I have a pair of apps that do that; I use NSDistributedNotificationCenter and the CF equivalent CFNotificationCenterGetDistributedCenter for the signals.
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Live updating user defaults from a prefpane to a running app
      • From: Shamyl Zakariya <email@hidden>
References: 
 >Re: Live updating user defaults from a prefpane to a running app (From: Greg Guerin <email@hidden>)
 >Re: Live updating user defaults from a prefpane to a running app (From: Lee Ann Rucker <email@hidden>)

  • Prev by Date: Re: Live updating user defaults from a prefpane to a running app
  • Next by Date: IKImageView 2 questions
  • Previous by thread: Re: Live updating user defaults from a prefpane to a running app
  • Next by thread: Re: Live updating user defaults from a prefpane to a running app
  • Index(es):
    • Date
    • Thread