title: Dynamically typecast from a function that returns a Class
body: <pre><code>    - (void)activate:(NSDictionary *)options {
        Class c = [self displayClass];
        self.display = [[c alloc] initWithOptions:options];
        (c *)self.display.delegate = self;
  </code></pre>
  
  <p>My display property is of a base Display class.</p>
  
  <p>Error on the last line. The delegate in question is only available to the current displayClass which is a sub-class of Display.</p>
  
  <p>How do I cast to set the delegate?</p>
  
  <p>EDIT:</p>
  
  <p>I understand that (Display *) works. I am trying to make the ((Display *) part dynamic. When I do     (c *)self.display).delegate = self; I get "Expected expression".</p>