title: using a delegate in a class method
body: <p>I want to invoke a delegate in class method. </p>
  
  <p>The example below obviously does not work, since the delegate is an instance variable that is accessed within a class method. (Error: instance variable 'delegate' accessed in class method)</p>
  
  <p>Is there an alertnative?</p>
  
  <p>My header file:</p>
  
  <pre><code>//  MyClass.h
  
  #import &lt;Foundation/Foundation.h&gt;
  
  @protocol MyDelegate &lt;NSObject&gt;
  
  -(void)update;
  
  @end
  
  @interface MyClass : NSObject
  {
      id&lt;MyDelegate&gt; delegate;
  }
  @property (nonatomic, retain) id delegate;
  
  +(void)methodThatInvokesDelegate;
  @end
  </code></pre>
  
  <p>My implementation file:</p>
  
  <pre><code>//  MyClass.m
  #import "MyClass.h"
  
   @implementation MyClass
   @synthesize delegate;
  
  +(void)methodThatInvokesDelegate{
  [delegate update];
   }
  
   @end
  </code></pre>