| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
I'm having trouble with my application crashing when there has been a Preferences file created. In trying to understand how things are working and how they are supposed to work, I find that the following code doesn't create a Preferences file, even on quitting the application.--
#import "test.h"
@implementation test
+ (void)initialize
{
//This doesn't seem to work.
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSMutableDictionary *appDefs = [NSMutableDictionary dictionary];
[appDefs setObject:@"NO" forKey:@"First Setting"];
[appDefs setObject:@"YES" forKey:@"Second Setting"];
[appDefs setObject:@"SNR" forKey:@"Third Setting"];
[defaults registerDefaults:appDefs];
}
@end
I had thought that it was supposed to set these values as the default preferences, but I guess I'm wrong. Later in the program when I write changes to say the "First Setting" in the defaults database, a Preferences file is created, and it contains that value, but not the others.
How is this supposed to work? Any ideas what I'm doing wrong?
| References: | |
| >When does a Prefs file get created by the NSUserDefaults defaults system? (From: Rob Frohne <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.