title: Activity Indicator doesn't spin
body: <p>I'm trying to add a spinning activity indicator (UIActivityIndicatorView) to my app while it parses data from the internet. I have an IBOutlet (spinner) connected to a UIActivityIndicatorView in IB. Initially I had it set up like this:</p>
  
  <pre><code>-
  
   (void) function {
          self.spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle: UIActivityIndicatorViewStyleWhite];
   self.spinner.hidesWhenStopped = YES;
   [spinner startAnimating];
   //parse data from internet
   [spinner stopAnimating];}
  </code></pre>
  
  <p>But the spinner wouldn't spin. I read that it had something to do with everything being on the same thread. So I tried this:</p>
  
  <pre><code>    - (void) newFunction {
          self.spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle: UIActivityIndicatorViewStyleWhite];
   self.spinner.hidesWhenStopped = YES;
   [spinner startAnimating];
   [NSThread detachNewThreadSelector: @selector(function) toTarget: self withObject: nil];
   [spinner stopAnimating];}
  </code></pre>
  
  <p>But still no luck. Any ideas? Thanks.</p>