• 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: Foundation tool & NSUserDefault
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Foundation tool & NSUserDefault


  • Subject: Re: Foundation tool & NSUserDefault
  • From: KK <email@hidden>
  • Date: Fri, 12 Jun 2009 07:18:13 -0400

Yes... I see. Thank you.
My other question is, can you change where this .plist file goes? My tool
runs as root, so when I use NSUserDefaults, it saves the .plist file in
/private/var/root/Library/Preferences, but I would prefer that it go right
in /Library/Preferences ... is this possible?

On Thu, Jun 11, 2009 at 12:10 PM, Nick Zitzmann <email@hidden> wrote:

>
> On Jun 11, 2009, at 5:19 AM, KK wrote:
>
>  I am writing a "Foundation tool" - a command-line utility that uses
>> Objective-C and the Foundation framework, and I'm trying to save
>> preferences
>> under the application domain.. My understanding is that you would need a
>> bundle identifier to do this, but if it's just a tool, can it have a
>> bundle
>> identifier?
>>
>> Or, do I have to use CFPreferences?
>>
>
>
> You can use CFPreferences if you wish, but if you use NSUserDefaults, the
> defaults will be written to a plist file with the same name as your
> executable if it has no bundle identifier. That might be good enough unless
> your tool has a very common name or something.
>
> I haven't tried it, but I've read on ADC that there is a way to embed an
> info.plist file in a tool by using this linker flag:
> -sectcreate __TEXT __info_plist $(SOURCE_ROOT)/$(INFOPLIST_FILE)
>
> Nick Zitzmann
> <http://www.chronosnet.com/>
>
>
_______________________________________________

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: Foundation tool & NSUserDefault
      • From: Sidney San Martín <email@hidden>
References: 
 >Foundation tool & NSUserDefault (From: KK <email@hidden>)
 >Re: Foundation tool & NSUserDefault (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: Get|SetControlProperty() equivalent
  • Next by Date: view drawing differences between Tiger and Leopard ?
  • Previous by thread: Re: Foundation tool & NSUserDefault
  • Next by thread: Re: Foundation tool & NSUserDefault
  • Index(es):
    • Date
    • Thread