bitboxer
bitboxer

Reputation: 554

Sharing config settings between 2 cocoa apps

I am new to cocoa development and want to create a little app. For that app I need a background worker that is running all the time and a prefpane-app that gives the user the opportunity to change the settings for that background worker.

The gui for the prefpane is ready, the background worker is ready, too. One of the few missing things is how to share the preferences between both apps. How do I notify the worker about changes of the preferences? And how do I store it in a way that both can read/write to it?

Upvotes: 0

Views: 218

Answers (1)

Georg Fritzsche
Georg Fritzsche

Reputation: 98984

For inter-process notifications, take a look at Foundations notifications - specifically NSDistributedNotificationCenter.

As for sharing settings, NSUserDefaults provides you with -addSuiteNamed:, which allows you to add a shared domain into the search list.

Upvotes: 2

Related Questions