title: Problems Implementing Search Bar with Parse Data
body: <p>I have searched the land of Google far and wide and I have found tutorials on this, but they are before IOS8.  I have tried to piece this together as best as I can, but yet when the app runs, and I type words into the search bar, nothing returns, or it crashes.  So here's how the view looks, and what each object means:</p>
  
  <p><img src="https://i.stack.imgur.com/K88Ds.png" alt="screenshot"></p>
  
  <p>Here is my JobListViewController.m File:</p>
  
  <pre><code>#import "JobDetailViewController.h"
  #import "JobListViewController.h"
  #import "Job.h"
  #import "SearchedResultCell.h"
  
  
  @interface JobListViewController () &lt;UISearchDisplayDelegate, UISearchBarDelegate&gt; {
  
  }
  
  @property (nonatomic, weak) IBOutlet UISearchBar *searchedBar;
  @property (nonatomic, strong) NSString *mainTitle;
  @property (nonatomic, strong) NSString *subTitle;
  @property (nonatomic, assign) BOOL canSearch;
  
  @end
  
  @interface JobListViewController ()
  
  @end
  
  @implementation JobListViewController
  {
      NSArray *jobs;
      NSArray *searchResults;
  }
  @synthesize searchedBar;
  @synthesize mainTitle;
  @synthesize subTitle;
  @synthesize canSearch;
  
  
  - (id)initWithCoder:(NSCoder *)aCoder
  {
      self = [super initWithCoder:aCoder];
      if (self) {
          // Custom the table
  
          // The className to query on
          self.parseClassName = @"Jobs";
  
          // The key of the PFObject to display in the label of the default cell style
          self.textKey = @"Position";
  
          // Whether the built-in pull-to-refresh is enabled
          self.pullToRefreshEnabled = YES;
  
          // Whether the built-in pagination is enabled
          self.paginationEnabled = YES;
  
          // The number of objects to show per page
          self.objectsPerPage = 10;
      }
      return self;
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      [self.searchedBar becomeFirstResponder];
  
  
  }
  
  - (void)viewWillAppear:(BOOL)animated {
      [super viewWillAppear:animated];
  
      self.canSearch = 0;
  
  }
  
  - (void)viewDidAppear:(BOOL)animated {
      [super viewDidAppear:animated];
  }
  
  - (void)viewWillDisappear:(BOOL)animated {
      [super viewWillDisappear:animated];
  }
  
  - (void)viewDidDisappear:(BOOL)animated {
      [super viewDidDisappear:animated];
  }
  
  - (void)viewDidUnload
  {
      [super viewDidUnload];
      // Release any retained subviews of the main view.
  }
  
  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  {
      return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
  }
  
  - (void)objectsWillLoad {
      [super objectsWillLoad];
  
      // This method is called before a PFQuery is fired to get more objects
  }
  
  
  - (PFQuery *)queryForTable
  {
      PFQuery *query;
  
      if (self.canSearch == 0)
      {
          query = [PFQuery queryWithClassName:@"Jobs"];
      }
      else
      {
          query = [PFQuery queryWithClassName:@"Jobs"];
  
          NSString *searchThis = [searchedBar.text uppercaseString];
          [query whereKey:@"Position" containsString:searchThis];
  
      }
  
  
      [query orderByAscending:@"Position"];
  
  
          query.cachePolicy = kPFCachePolicyCacheThenNetwork;
  
  
      return query;
  }
  
  
  
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath object: (PFObject *)object
  {
      static NSString *simpleTableIdentifier = @"JobCell";
          static NSString *pimpleTableIdentifier = @"JobCell";
  
      UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
  
      if (cell == nil) {
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
  
      SearchedResultCell *cell = [self.tableView dequeueReusableCellWithIdentifier:pimpleTableIdentifier];
  
      if (cell == nil) {
          cell = [[SearchedResultCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:pimpleTableIdentifier];
  
          }
  
          [self configureSearchResult:cell atIndexPath:indexPath object:object];
  
  
      }
  
      // Configure the cell
      PFFile *thumbnail = [object objectForKey:@"imageFile"];
      PFImageView *thumbnailImageView = (PFImageView*)[cell viewWithTag:100];
      thumbnailImageView.image = [UIImage imageNamed:@"placeholder.jpg"];
      thumbnailImageView.file = thumbnail;
      [thumbnailImageView loadInBackground];
  
      UILabel *positionLabel = (UILabel*) [cell viewWithTag:101];
      positionLabel.text = [object objectForKey:@"Position"];
      UILabel *rotationLabel = (UILabel*) [cell viewWithTag:102];
      rotationLabel.text = [object objectForKey:@"Rotation"];
      UILabel *locationLabel = (UILabel*) [cell viewWithTag:103];
      locationLabel.text = [object objectForKey:@"Location"];
      UILabel *typeLabel = (UILabel*) [cell viewWithTag:104];
      typeLabel.text = [object objectForKey:@"Type"];
  
  
  return cell;
  }
  
  - (void) objectsDidLoad:(NSError *)error
  {
      [super objectsDidLoad:error];
  
      NSLog(@"error: %@", [error localizedDescription]);
  }
  
  
  - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
      if ([segue.identifier isEqualToString:@"showJobDetail"]) {
          NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
  
          Job *job = [[Job alloc] init];
  
          JobDetailViewController *destViewController = segue.destinationViewController;
  
          PFObject *object = [self.objects objectAtIndex:indexPath.row];
          job.position = [object objectForKey:@"Position"];
          job.name = [object objectForKey:@"Name"];
          job.email = [object objectForKey:@"Email"];
          job.phone = [object objectForKey:@"Phone"];
          job.imageFile = [object objectForKey:@"imageFile"];
          job.rotation = [object objectForKey:@"Rotation"];
          job.location = [object objectForKey:@"Location"];
            job.type = [object objectForKey:@"Type"];
          job.clearance = [object objectForKey:@"Clearance"];
          job.job_description = [object objectForKey:@"Job_Description"];
          job.qualifications = [object objectForKey:@"Qualifications"];
          destViewController.job = job;
  
      }
  
  }
  
  - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
  {
  
      [self clear];
  
      self.canSearch = 1;
  
      [self.searchedBar resignFirstResponder];
  
      [self queryForTable];
      [self loadObjects];
  
  }
  /*
   - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
   {
   if (searchResults == nil) {
   return 0;
   } else if ([searchResults count] == 0) {
   return 1;
   } else {
   return [self.objects count];
   }
   }
   */
  - (void)configureSearchResult:(SearchedResultCell *)cell atIndexPath:(NSIndexPath *)indexPath object:(PFObject *)object
  {
      mainTitle = [object objectForKey:@"Position"];
      cell.mainTitle.text = mainTitle;
  
      subTitle = [object objectForKey:@"Type"];
      cell.detail.text = subTitle;
  
       // Implement this if you want to Show image
       cell.showImage.image = [UIImage imageNamed:@"placeholder.jpg"];
  
       PFFile *imageFile = [object objectForKey:@"imageFile"];
  
       if (imageFile) {
       cell.showImage.file = imageFile;
       [cell.showImage loadInBackground];
       }
  }
  
  
  #pragma mark - UITableViewDelegate
  
  - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
  
      [tableView deselectRowAtIndexPath:indexPath animated:YES];
  
      [searchedBar resignFirstResponder];
  
      if ([self.objects count] == indexPath.row) {
          [self loadNextPage];
      } else {
          PFObject *photo = [self.objects objectAtIndex:indexPath.row];
          NSLog(@"%@", photo);
  
          // Do something you want after selected the cell
      }
  }
  
  #pragma mark - UIScrollViewDelegate
  
  
  - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
      [self.searchedBar resignFirstResponder];
  }
  
  - (void)searchBarCancelButtonClicked:(UISearchBar *) searchBar {
      [self.searchedBar resignFirstResponder];
      [self queryForTable];
      [self loadObjects];
  
  }
  
  
  
  
  @end
  </code></pre>
  
  <p>I cannot find where I am going wrong. Any help whatsoever would be much appreciated.  Or if anything if you can point me in the right direction.  </p>