title: How can I refresh TableViewCell data with Refresh Control
body: <p>I am attempting to load data into a <code>UITableViewCell</code> whenever the refresh control is activated. My code successfully retrieves the data and I can verify this with <code>NSLog</code>, but the ViewCell does not update with the new data when Refresh Control ends. Can anyone point me in the right direction?</p>
  
  <p>Below is MyViewController.m file:</p>
  
  <pre><code>#define JSON_URL @"https://website.com"
  #import "MyViewController.h"
  #import "Object.h"
  #import "MyViewCell.h"
  @interface MyViewController ()
  
  
  @property (nonatomic,strong) NSMutableArray *objectHolderArray;
  @end
  
  @implementation MyViewController
  - (void)viewDidLoad
  {
  
  NSURL *blogURL = [NSURL URLWithString:JSON_URL];
  NSData *jsonData = [NSData dataWithContentsOfURL:blogURL];
  NSError *error = nil;
  NSDictionary *dataDictionary = [NSJSONSerialization
                                  JSONObjectWithData:jsonData options:0 error:&amp;error];
  for (NSDictionary *bpDictionary in dataDictionary) {
      Object *currenHotel = [[Object alloc]Station:[bpDictionary objectForKey:@"station"] Status:[bpDictionary objectForKey:@"status"]];
      [self.objectHolderArray addObject:currenHotel];
  }
  [super viewDidLoad];
  
  //to add the UIRefreshControl to UIView
  UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
  refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"Please Wait..."]; //to give the attributedTitle
  [refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
  
  }
  
  
  
  - (IBAction)refresh:(UIRefreshControl *)sender {
      [self viewDidLoad];
      [sender endRefreshing];
  }
  
  
  
  
  #pragma mark - Table view data source
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  {
  return 1;
  }
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:
  (NSInteger)section
  {
      return [self.objectHolderArray count];
  }
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:
  (NSIndexPath *)indexPath
  {
  static NSString *CellIdentifier = @"Cell";
  MartaViewCell *cell = [tableView     dequeueReusableCellWithIdentifier:CellIdentifier
                                                    forIndexPath:indexPath];
  Object *currentHotel = [self.objectHolderArray
                               objectAtIndex:indexPath.row];
  
  cell.lblStation.text = currentHotel.station;
  cell.lblStatus.text = currentHotel.status;
  return cell;
  }
  -(NSMutableArray *)objectHolderArray{
  if(!_objectHolderArray) _objectHolderArray = [[NSMutableArray alloc]init];
  return _objectHolderArray;
  }
  
  
  @end
  </code></pre>