title: UIActivityIndicatorView won't stop
body: <p>I'm playing with some JSON parsing in iOS and i wanted to add a spinner, this works wel but i can't stop the spinner and i would like to understand why.</p>
  
  <p><code>[spinner stopAnimating]</code> is called in the async block and i believe thats where the problem is, maybe because i can't call the method on spinner in the block? i've logged the spinner obj and the output is: </p>
  
  <pre><code>&lt;UIActivityIndicatorView: 0x76905f0; frame = (150 230; 20 20); layer = &lt;CALayer: 0x768ffb0&gt;&gt;
  </code></pre>
  
  <p>Maybe somebody can make me understand how to deal with this async methods in objective-c. I'm a absolute beginner.</p>
  
  <p>The code:</p>
  
  <pre><code>- (void)viewDidLoad{
    [super viewDidLoad];
  
    UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
    spinner.center = CGPointMake(160, 240);
    [self.view addSubview:spinner];
    [spinner startAnimating];
  
  
    dispatch_async(kBgQueue, ^{
  
      NSData* data = [NSData dataWithContentsOfURL:
                      kLatestKivaLoansURL];
      [self performSelectorOnMainThread:@selector(fetchedData:)
                             withObject:data waitUntilDone:YES];
       NSLog(@"loans: %@", spinner);
       [spinner stopAnimating];
    });
  
  
  }
  </code></pre>