title: Filtering NSMutableArray with NSPredicate
body: <p>I am currently trying to implement a search bar into my table view. I want to allow users to search through all of their transactions by name, however I am having issues.</p>
  
  <p>I have read tons of examples on this however I am still having problems with my app crashing. </p>
  
  <p>Here is the code I am using for the filter:</p>
  
  <pre><code>func filterContentForSearchText(searchText: NSString) {
      let resultPredicate = NSPredicate(format: "name contains[c] %@", searchText)
      searchResults = arrayDataPayments.filteredArrayUsingPredicate(resultPredicate)
  }
  
  func searchDisplayController(controller: UISearchDisplayController!, shouldReloadTableForSearchString searchString: String!) -&gt; Bool {
      self.filterContentForSearchText(searchString)
      return true
  }
  </code></pre>
  
  <p>arrayDataPayments is defined as an NSMutableArray and stores sting data. This is my ArrayData class code:</p>
  
  <pre><code>import UIKit
  
  var arrayDataPayments: NSMutableArray = []
  var arrayDataCost: NSMutableArray = []
  var arrayDataDate: NSMutableArray = []
  var arrayDataImage: NSMutableArray = []
  var arrayDataValue: NSMutableArray = []
  
  class ArrayData: NSObject {
  
      func paymentsArray() -&gt; NSMutableArray { return arrayDataPayments }
  
      func costArray() -&gt; NSMutableArray { return arrayDataCost }
  
      func dateArray() -&gt; NSMutableArray { return arrayDataDate }
  
      func imageArray() -&gt; NSMutableArray { return arrayDataImage }
  
      func valueArray() -&gt; NSMutableArray { return arrayDataValue }
  }
  </code></pre>
  
  <p>Currently my app crashes when there is at least one cell in the table and I tap a key on the keyboard to search for something. I am getting this error:</p>
  
  <p>Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[&lt;__NSCFString 0x7f9e88719320> valueForUndefinedKey:]: this class is not key value coding-compliant for the key name.'</p>