title: Center UIActivityIndicatorView in a UIImageView
body: <p>I've created a custom subclass of <code>UIImageView</code> and in one method I want to add an activity indicator to the center while the image is loading. I'm using the following code, but the activity monitor is positioned well outside of the <code>UIImageView</code>. What can I do to center it exactly within the bounds of the <code>UIImageView</code>?</p>
  
  <pre><code>UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
  
  indicator.autoresizingMask =
  UIViewAutoresizingFlexibleTopMargin |
  UIViewAutoresizingFlexibleRightMargin |
  UIViewAutoresizingFlexibleBottomMargin |
  UIViewAutoresizingFlexibleLeftMargin;
  
  indicator.center = self.center;
  
  [self addSubview:indicator];    
  [indicator startAnimating];
  </code></pre>