title: Clear Datasource, reloadData, Cells still have old info?
body: <h3>After wiping the datasource and reloadData, tableviewcells still show old information.</h3>
  <p>I'm creating a tableview that shows search results for users in a database.</p>
  <p>When I perform a search, the datasource is populated and users are added in:</p>
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  </code></pre>
  <p>For each cell that is created, an associating profile photo and button are created and added to the current cell.</p>
  <p>I've got a method I'm using just for testing, which clears the datasource and reloads all the cells</p>
  <pre><code>- (IBAction)cleardaTables:(id)sender {
      [_dataSource removeAllObjects];
      [self.tableView reloadData];
  }
  </code></pre>
  <p>If I clear my search with that button, and search something else, or display a placeholder cell that says &quot;search for a user,&quot; my placeholder cell still shows a button from one of the previous cells in its place.</p>
  <p>Anyone know how to truly clear cell data and display fresh cells?</p>
  <p>Code - sorry messy</p>
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *searchResultCell = @&quot;searchResultCell&quot;;
      EIConnectionsGlobalSearchResultCell *cell = [tableView dequeueReusableCellWithIdentifier:searchResultCell];
      
      if (cell == nil) {
          cell = [[EIConnectionsGlobalSearchResultCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:searchResultCell];
      }
      
      //Create &quot;no results&quot; cell if datasource is empty after search
      if (_emptySearch == 1)
      {
          cell.imageView.image = nil;
          cell.labelName.text = @&quot;No results...&quot;;
          cell.labelConnectionStatus.text = @&quot;Try another search.&quot;;
          cell.labelConnectionStatus.textColor = [UIColor grayColor];
          [cell setUserInteractionEnabled:NO];
          
          return cell;
      }
      else if (_emptySearch == 0)
      {
          //Assigning Search Result
          NSMutableDictionary *searchResult = [_dataSource objectAtIndex:indexPath.row];
          
          //Text Configs
          cell.labelName.text = [searchResult objectForKey:@&quot;Name&quot;];
          
          //Assign and Convert ConnectionStatus Number to string and color
          int connectionStatusInt = [[searchResult objectForKey:@&quot;ConnectionStatus&quot;] intValue];
          NSMutableArray *connectionStatus = [self connectionStatusToString:connectionStatusInt withIndexPath:indexPath];
          cell.labelConnectionStatus.text = connectionStatus[0];
          cell.labelConnectionStatus.textColor = connectionStatus[1];
          
          //Setting up profile photo for cell
          if ([[searchResult objectForKey:@&quot;picDownloaded&quot;] isEqualToString:@&quot;no&quot;] || ![searchResult objectForKey:@&quot;picDownloaded&quot;]) {
              if (self.tableView.dragging == NO &amp;&amp; self.tableView.decelerating == NO)
              {
                  [self startProfilePicDownload:searchResult andIndex:indexPath];
              }
              //Setting Default Image while downloading
              cell.imageView.image = defaultProfileImage;
          }
          else
          {
              //A profile pic exists in cache, so assign it to the view
              cell.imageView.image = [searchResult objectForKey:@&quot;profilePic&quot;];
          }
          
          //setting up cell actions
          UIButton *cellAction = [UIButton buttonWithType:UIButtonTypeCustom];
          cellAction.frame = CGRectMake(cell.frame.size.width - 52, 18.0f, 25.0f, 25.0f);
          UIImage *buttonImage = [UIImage imageNamed:@&quot;Arrow-Icon&quot;];
          [cellAction setImage:buttonImage forState:UIControlStateNormal];
          cellAction.imageView.contentMode = UIViewContentModeScaleAspectFit;
          [cellAction setTag:indexPath.row];
          [cellAction addTarget:self action:@selector(showCellActionOptions:) forControlEvents:UIControlEventTouchUpInside];
          [cell addSubview:cellAction];
          
          return cell;
      }
      
      return cell;
  }
  </code></pre>