title: How to add a UIActivityIndicator View in my iOS app?
body: <p>I don't know how to explain but... If you understand me when I say a "loading circle" perfect, I just want to do this</p>
  
  <pre><code>    // Start loading in the middle of the screen frozing all interaction
      for (int c = 0; c &lt; ([barcos count] - 1); c++)
      {
          NSArray *datos = [[barcos objectAtIndex:c] componentsSeparatedByString:@";"];
          NSString *nombreImagen = [datos objectAtIndex:2];
          NSURL *accesoFtp = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@",urlFtp,nombreImagen]];
          NSData *imagen = [NSData dataWithContentsOfURL:accesoFtp];
          [imagen writeToFile:[[NSString alloc] initWithString: [docsDir stringByAppendingPathComponent:[NSString stringWithFormat:@"Barcos/%@",nombreImagen]]] atomically:NO];
      }
      // Stop frozing all interaction and remove the loading circle
  </code></pre>
  
  <p>Probabbly I have to add a thread or something but I don't know how to do what I want exactly I hope you can help me, again. Thanks.</p>
  
  <p>EDIT:</p>
  
  <pre><code>UIActivityIndicatorView *activityIndicator;
  activityIndicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
  activityIndicator.frame = CGRectMake(0.0, 0.0, 40.0, 40.0);
  activityIndicator.center = self.view.center;
  [self.view addSubview: activityIndicator];
  
  activityIndicator.startAnimating;
  
  dispatch_queue_t queue = dispatch_get_global_queue(0,0);
  
  dispatch_async(queue, ^{
  
          for (int c = 0; c &lt; ([barcos count] - 1); c++)
          {
              NSArray *datos = [[barcos objectAtIndex:c] componentsSeparatedByString:@";"];
              NSString *nombreImagen = [datos objectAtIndex:2];
              NSURL *accesoFtp = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@",urlFtp,nombreImagen]];
              NSData *imagen = [NSData dataWithContentsOfURL:accesoFtp];
          [imagen writeToFile:[[NSString alloc] initWithString: [docsDir stringByAppendingPathComponent:[NSString stringWithFormat:@"Barcos/%@",nombreImagen]]] atomically:NO];
          }
  
      dispatch_sync(dispatch_get_main_queue(), ^{
          activityIndicator.stopAnimating;
      });
  });
  </code></pre>
  
  <p>Two things</p>
  
  <pre><code> 1.- The activity indicator is too small but works, if I can to it bigger or same size but make darker the background would be better (Thanks!)
   2.- I have a warning with startAnimating and stopAnimating "Property access result unused - getters should not be used for side effects"
  </code></pre>
  
  <p>Thanks =)</p>