Why should I check [self class] == [LevelAppDelegate class] in the initialization method?
In the AppDelegate example from BubbleLevel 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 are they doing this [self class] == [LevelAppDelegate class]?
+1
a source to share