Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UserDefaults and domain names



On Thursday, July 19, 2001, at 12:09 PM, Tom Waters wrote:

I'm working on the user defaults mechanism in my app and I noticed that many applications use a reverse fully qualified domain name, similar to the java package convention.

For example, com.apple.TextEdit, or com.microsoft.explorer...

My read of the NSUserDefaults docs indicated that it uses the bundle's name for the domain name, thus mine is coming out just plain FileView, rather than com.whidbeysoft.FileView.

Can someone tell me how to set my own fully qualified domain name in the user defaults?

You need to give your bundle a CFBundleIdentifier of the appropriate form. See the InfoPlist release note for more details on various info dictionary keys. In ProjectBuilder, you go to the pane where you set up the info dictionary keys, and set the value com.whidbeysoft.FileView for the CFBundleIdentifier key. Really, all bundles should have a CFBundleIdentifier; the bundle name is used only as a fallback if it is not present.

Douglas Davidson


References: 
 >UserDefaults and domain names (From: Tom Waters <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.