• 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: Nick Zitzmann <email@hidden>
  • Date: Thu, 11 Jun 2009 10:10:58 -0600


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: KK <email@hidden>
References: 
 >Foundation tool & NSUserDefault (From: KK <email@hidden>)

  • Prev by Date: API for fetching the computer name in cocoa
  • Next by Date: Carbon Boolean
  • Previous by thread: Foundation tool & NSUserDefault
  • Next by thread: Re: Foundation tool & NSUserDefault
  • Index(es):
    • Date
    • Thread