title: Objective-C Class Constructors
body: <p>In my Objective-C project I have a Country class (NSManagedObject subclass). When comparing a country to another its important for me to know the total world population. I'm doing this operation a lot and it's getting expensive. I decided to put the population in a static variable of Country. However I want to initialize this value before ever making an instance of Country.</p>
  
  <p>Apparently C# has something called Class Constructors which get called before you ever init an instance of the same class. This would be a perfect time for me to set the world population variable. But I can't figure out a way to do something similar with Objective-C. Is there even a way to do that?</p>
  
  <p>I'm open to other approaches of this as well. Thanks, Rob</p>