One Quickie


Registering default user defaults (Bindings->General)
Here is one way to register the "factory settings" for your user defaults (preferences / configurations). You will pick up these values automagically via bindings to the Shared Defaults.
- (void) setDefaultPrefs
{
    NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];

    [dictionary setObject: NSLocalizedString(@"BorkDown", nil)
                forKey: @"menuTitle"];

    [dictionary setObject: NSLocalizedString(@"Time has run out.", nil)
                forKey: @"alertWindowText"];

    // and any other preferences you might have

    [[NSUserDefaults standardUserDefaults]
        registerDefaults: dictionary];

} // setDefaultPrefs



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com