• 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: A Mac App & helper NSStatusItem - how to share preferences
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A Mac App & helper NSStatusItem - how to share preferences


  • Subject: Re: A Mac App & helper NSStatusItem - how to share preferences
  • From: Trygve Inda <email@hidden>
  • Date: Wed, 11 Feb 2009 10:55:37 +0000
  • Thread-topic: A Mac App & helper NSStatusItem - how to share preferences

> Steve Cronin (email@hidden) on 2008-12-28 8:41 PM said:
>
>> I have an application which will have an optional helper NSStatusItem.
>> The statusItem is a stand-alone application which can be installed as
>> a LoginItem.
>>
>> I want this status item to be able to read the preferences file from
>> the application.
>
> No need to drop to CFPreferences.  Let's say your 2 bundle identifiers
> are "com.cronin.mainapp" and "com.cronin.helper".
>
> In your helper app, just do this:
>
> NSUserDefaults* sud = [NSUserDefaults standardUserDefaults];
> [sud addSuiteNamed:@"com.cronin.mainapp"];
>
> Sean

In my helper app I use:

userDefaults =
[[NSUserDefaults standardUserDefaults]
persistentDomainForName:kMainAppIdent];

You just need to make sure there is no chance of the helper and the host
writing at the same time to the same file.

Trygve


_______________________________________________

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: A Mac App & helper NSStatusItem - how to share preferences
      • From: Michael Ash <email@hidden>
  • Prev by Date: ProcessInformationCopyDictionary
  • Next by Date: Re: ProcessInformationCopyDictionary
  • Previous by thread: Re: ProcessInformationCopyDictionary
  • Next by thread: Re: A Mac App & helper NSStatusItem - how to share preferences
  • Index(es):
    • Date
    • Thread