title: ReloadData not working in my TableViewController
body: <p>Good afternoon,</p>
  
  <p>I'm trying to display the data in my <strong>UITableViewController</strong> (CarTableViewController) and at the moment the rows are being populate with the correct info and also the <strong>refreshControl</strong> is working fine (and very fast, like 1 second) but the first time I entry in my App the data is not displayed (I have to move the screen with my finger and then the data is displayed). (I have to wait like +15 seconds until it appears automatically, but sometimes is not showing).</p>
  
  <p><strong><em>What can I do in order to display the data automatically and fast?</em></strong></p>
  
  <p>I tried to move the <strong>reloadData</strong> into every method and it's always the same and I don't know what else to do...! I will be much appreciated if you can help me with that.</p>
  
  <p><strong>CarTableViewController.m</strong></p>
  
  <pre><code>#import "CarTableViewController.h"
  #import "CarTableViewCell.h"
  #import "CarTableViewController.h"
  #import "CarDetailViewController.h"
  #import &lt;SDWebImage/UIImageView+WebCache.h&gt;
  
  @implementation CarTableViewController
  
  @synthesize carMakes = _carMakes;
  @synthesize carModels = _carModels;
  @synthesize carImages = _carImages;
  
  @synthesize likes = _likes;
  @synthesize comments = _comments;
  @synthesize username = _username;
  @synthesize refuser = _refuser;
  @synthesize profileImage = _profileImage;
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      [self fetchJson];
  
      [self.tableView reloadData];
  
      // Initialize the refresh control.
      self.refreshControl = [[UIRefreshControl alloc] init];
      self.refreshControl.backgroundColor = [UIColor blackColor];
      self.refreshControl.tintColor = [UIColor whiteColor];
      [self.refreshControl addTarget:self
                              action:@selector(fetchJson)
                    forControlEvents:UIControlEventValueChanged];
  }
  
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  {
      // Return the number of sections.
      return 1;
  }
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
      // Return the number of rows in the section.
      return [_jsonArray count];
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *CellIdentifier = @"carTableCell";
      CarTableViewCell *cell = [tableView
                                dequeueReusableCellWithIdentifier:CellIdentifier];
  
      if (cell == nil) {
          cell = [[CarTableViewCell alloc]
                  initWithStyle:UITableViewCellStyleDefault
                  reuseIdentifier:CellIdentifier];
      }
  
      // Configure the cell...
      cell.makeLabel.text = [[_jsonArray objectAtIndex:indexPath.row] valueForKey:@"id"];
      cell.likes.text = [[_jsonArray objectAtIndex:indexPath.row] valueForKey:@"likes"];
      cell.comments.text = [[_jsonArray objectAtIndex:indexPath.row] valueForKey:@"comments"];
      cell.username.text = [[_jsonArray objectAtIndex:indexPath.row] valueForKey:@"username"];
      cell.refuser.text = [[_jsonArray objectAtIndex:indexPath.row] valueForKey:@"user_ref"];
      cell.modelLabel.text = [[_jsonArray objectAtIndex:indexPath.row] valueForKey:@"user"];
  
      NSURL * imageURL = [NSURL URLWithString:[[_jsonArray objectAtIndex:indexPath.row] valueForKey:@"imagen"]];
      [cell.carImage setImageWithURL:imageURL
                    placeholderImage:[UIImage imageNamed:@"placeholder.png"]
                             options:SDWebImageRefreshCached];
      NSURL * imageURL2 = [NSURL URLWithString:[[_jsonArray objectAtIndex:indexPath.row] valueForKey:@"image"]];
  
      [cell.profileImage setImageWithURL:imageURL2
                        placeholderImage:[UIImage imageNamed:@"image"]
                              options:SDWebImageRefreshCached];
  
      return cell;
  }
  
  -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
  {
      if ([[segue identifier] isEqualToString:@"ShowCarDetails"])
      {
          CarDetailViewController *detailViewController = [segue destinationViewController];
  
          NSIndexPath *myIndexPath = [self.tableView indexPathForSelectedRow];
  
          detailViewController.carDetailModel = [[NSArray alloc]
                                                 initWithObjects:
                                                 [[_jsonArray objectAtIndex:[myIndexPath row]] valueForKey:@"date"],
                                                 [[_jsonArray objectAtIndex:[myIndexPath row]] valueForKey:@"id"],
                                                 [[_jsonArray objectAtIndex:[myIndexPath row]] valueForKey:@"imagen"],
                                                 nil];
      }
  }
  
  -(void)fetchJson {
      dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
      dispatch_async(queue, ^{
  
          NSString * urlString = [NSString stringWithFormat:@"http://mywebsite.com/service.php"];
          NSURL * url = [NSURL URLWithString:urlString];
          NSData * data = [NSData dataWithContentsOfURL:url];
  
          self.carModels = [[NSMutableArray alloc] init];
          self.carMakes = [[NSMutableArray alloc] init];
          self.carImages = [[NSMutableArray alloc] init];
          self.likes = [[NSMutableArray alloc] init];
          self.comments = [[NSMutableArray alloc] init];
  
          @try
          {
              NSError *error;
              [_jsonArray removeAllObjects];
              _jsonArray = [NSJSONSerialization
                           JSONObjectWithData:data
                           options:NSJSONReadingMutableContainers|NSJSONReadingMutableLeaves
                           error:&amp;error];
  
              for(int i=0;i&lt;_jsonArray.count;i++)
              {
                  NSDictionary * jsonObject = [_jsonArray objectAtIndex:i];
                  NSString* imagen = [jsonObject objectForKey:@"imagen"];
                  [_carImages addObject:imagen];
  
                  NSDictionary * jsonObject2 = [_jsonArray objectAtIndex:i];
                  NSString* user = [jsonObject2 objectForKey:@"user"];
                  [_carMakes addObject:user];
  
                  NSDictionary * jsonObject3 = [_jsonArray objectAtIndex:i];
                  NSString* date = [jsonObject3 objectForKey:@"date"];
                  [_carModels addObject:date];
              }
          }
          @catch (NSException * e)
          {
              NSLog(@"Exception: %@", e);
          }
          @finally
          {
              [self.tableView reloadData];
              [self.refreshControl endRefreshing];
          }
      }
      );
  }
  
  @end
  </code></pre>
  
  <p><strong>CarTableViewController.h</strong></p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface CarTableViewController : UITableViewController
  
  @property (nonatomic, strong) IBOutlet UITableView *tableView;
  
  @property (nonatomic, strong) NSMutableArray *carImages;
  @property (nonatomic, strong) NSMutableArray *carMakes;
  @property (nonatomic, strong) NSMutableArray *carModels;
  
  @property (nonatomic, strong) NSMutableArray *likes;
  @property (nonatomic, strong) NSMutableArray *comments;
  @property (nonatomic, strong) NSMutableArray *username;
  @property (nonatomic, strong) NSMutableArray *refuser;
  @property (nonatomic, strong) NSMutableArray *profileImage;
  
  @property (nonatomic, strong) NSMutableArray *jsonArray;
  
  @end
  </code></pre>
  
  <p>Thanks in advance.</p>