Objective-C initialize (static method) called more that once?
问题 I have code similar to this in Objective-C: SubclassOfNSObject *GlobalVariableThatShouldNeverChange; @implementation MyClass +(void) initialize { [super initialize]; GlobalVariableThatShouldNeverChange = [[SubclassOfNSObject alloc] init]; // Change more stuff with GlobalVariableThatShouldNeverChange } @end I have this referenced throughout code, and the pointer to this should never change because I am using it everywhere through my code. The problem is, that when I run my tests using GHUnit ,