title: class method where self if used within a block
body: <p>I've got a class method that uses <code>dispatch_once</code> to create a static object. Inside the <code>dispatch_once</code> block I use <code>[self class]</code> and was wondering if I need to use a weak reference to <code>self</code> to avoid a retain cycle?</p>
  
  <pre><code>+ (NSArray *)accountNames{
      static NSArray *names = nil;
      static dispatch_once_t predicate;
      dispatch_once(&amp;predicate, ^{
          names = [[[self class] accounts] allKeys];
          names = [names sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
      });
      return names;
  }
  </code></pre>
  
  <p>If I use a weak reference to <code>self</code> I get a warning:</p>
  
  <pre><code>+ (NSArray *)accountNames{
      static NSArray *names = nil;
      static dispatch_once_t predicate;
      __weak TUAccount *wself = self;
      dispatch_once(&amp;predicate, ^{
          names = [[[wself class] accounts] allKeys];
          names = [names sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
      });
      return names;
  }
  </code></pre>
  
  <p><strong>Incompatible pointer types initializing 'TUAccount *__weak' with an expression of type 'const Class'</strong></p>
  
  <p>Because I get a warning I don't think I need to use a weak reference to <code>self</code> in this case but I wanted to see what you guys thought.</p>