title: Sort Fetch Resullts Controller based on Users Button Click IOS
body: <p>I am making an Iphone app and  am trying to perform a sort on my fetched results controller based on a user tapping a specific button. When the user clicks the button I put the code I have shown below, however I get an error saying</p>
  
  <blockquote>
    <p>-[NSSortDescriptor count]: unrecognized selector sent to instance 0x6bc3250</p>
    
    <p>*** Terminating app due to uncaught exception
    'NSInvalidArgumentException', reason: '-. How can i fix this and get
    my data sorted based on the users button click?</p>
  </blockquote>
  
  <pre><code>- (IBAction)btnValue:(id)sender {
      self.model.frc_Work.delegate = self;
  
      self.model.frc_Work.fetchRequest.sortDescriptors = [NSSortDescriptor sortDescriptorWithKey:@"Value" ascending:YES];
  
      [NSFetchedResultsController deleteCacheWithName:@"Work"];
  
      NSError *error = nil;
      [self.model.frc_Work performFetch:&amp;error];
  }
  </code></pre>