title: Giving each subclass its own copy of a class variable
body: <p>I have the following class in my iOS application (it is like an abstract class from the Java world).</p>
  
  <pre><code>@implementation WSObject
  
  static NSDictionary* _dictionary = nil;
  +(NSDictionary*) dictionary {
      if (_dictionary == nil) {
          _dictionary = [NSKeyedUnarchiver unarchiveObjectWithFile:[self localStorePath]];
      }
      return _dictionary;
  }
  
  ...
  
  @end
  </code></pre>
  
  <p>I then have multiple classes which implement this above <code>WSObject</code> with the class method <code>dictionary</code>. The problem is, that each of these classes should have their own <code>_dictionary</code>, but they are all sharing the same object from the super class. I could, of course, copy to all the subclasses, but that would break the reusability. Besides this getter, there are other class methods in <code>WSObject</code> which mutate the dictionary. Because of this, there would be a several class methods which should be in every subclass.</p>
  
  <p>How can I solve this in a smart way? Please tell me if my description is insufficient.</p>