title: What is the proper way to display a loading indicator while getting data from a URL
body: <p>I'm somewhat new to objective-c, i'm developing a news iOS application, the app gets all its contents using JSON parsing from a url, i'm using <code>AFNetworking</code> for that and this is the method that i made: </p>
  
  <pre><code>- (void)getContents
  {
      NSString *urlString = @"http://some-url-that-has-json-output/";
      urlString = [urlString stringByAppendingString:self.articleId];
      NSLog(@"The call url is: %@",urlString);
      NSURL *url = [NSURL URLWithString:urlString];
  
      NSURLRequest *request = [NSURLRequest requestWithURL:url];
      //AFNetworking asynchronous url request
      AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc]
                                           initWithRequest:request];
      operation.responseSerializer = [AFJSONResponseSerializer serializer];
      [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
          NSLog(@"The JSON data is: %@", responseObject);
          jsonContents = [responseObject objectForKey:@"article"];
          [self LoadStructure];
      } failure:nil];
      [operation start];
  }
  </code></pre>
  
  <p>Now the data loads fine with this method.</p>
  
  <p><strong>My Question:</strong> How to display a loading indicator (could be a GIF) while getting the data ? and is this method above is the proper or best way to get data from a url ?</p>