title: Create custom dynamic classes in objective-c
body: <p>In my application i have an <code>UIViewController</code> that i uses a lot of <code>UIAlertView</code> to ask things to the user.</p>
  
  <p>Because i need the response of each <code>UIAlertView</code> i have made my controller a delegate of <code>UIAlertViewDelegate</code>, this works fine but after 7 <code>UIAlertView</code>'s i`m trying to find a better way to use delegates.</p>
  
  <p>In java i know that i can create inline classes for a single purpose, like in this question: <a href="https://stackoverflow.com/questions/8913406/java-inline-class-definition">Java - inline class definition</a></p>
  
  <p>What i want to know is: Is there a way to create a class to be delegate dynamically? to achieve something like this</p>
  
  <pre><code>id&lt;UIAlertViewDelegate&gt; myCustomClass = @class {
      my class code goes here
  }
  
  UIAlertView* alertView;
  alertView = [[UIAlertView alloc] initWithTitle:@"Title"
                                         message:@"Message"
                                        delegate:myCustomClass
                               cancelButtonTitle:@"No"
                               otherButtonTitles:@"OK", @"Sure", @"Maybe", nil] ];    
  [alertView show];
  </code></pre>