In the AppDelegate of the BubbleLevel example from Apple they do something like this:
+ (void)initialize {
if ([self class] == [LevelAppDelegate class]) {
// Register a default value for the instrument calibration.
// This will be used if the user hasn't calibrated the instrument.
NSNumber *defaultCalibrationOffset = [NSNumber numberWithFloat:0.0];
NSDictionary *resourceDict = [NSDictionary dictionaryWithObject:defaultCalibrationOffset forKey:BubbleLevelCalibrationOffsetKey];
[[NSUserDefaults standardUserDefaults] registerDefaults:resourceDict];
}
}
Why do they do that [self class] == [LevelAppDelegate class] ?