使用dictionaryWithObjectsAndKeys可以简便地手工设置默认字典:

 
defaults = [NSDictionary dictionaryWithObjectsAndKeys:
                     [NSNumber numberWithFloat: 25.0], @"density",
                     [NSNumber numberWithFloat: 40.0], @"rate",
                     nil];