title: Saving Bool Value on to Plist and Update
body: <p>if my root is a array and is filled with dictionaries so on viewcontroller 1 is set up </p>
  
  <pre><code>let path = Bundle.main.path(forResource:"Animals", ofType: "plist")
  let dics = NSArray(contentsOfFile: path!) as! [NSMutableDictionary] 
  </code></pre>
  
  <p>and viewcontroller 2 is set up</p>
  
  <pre><code>let path = Bundle.main.path(forResource:"Animals", ofType: "plist")
  
  if FileManager.default.fileExists(atPath: path!){
  let dics = NSArray(contentsOfFile: path!) as! [NSMutableDictionary] 
  dics.setValue(isFavorite, ForKey: "fav")
  dics.write(toFile: path!, atomically: true)
  </code></pre>
  
  <p>I put isFavorite as a varible at the top of the code and if user hits the button isFavorite changes from false to true and vice versa. isFavorite = !isfavorite. Now if I run this code it states that NSMutableDictionary has no member setValue or write. I am not sure how to let the system know that I clicked on the second dictionary cell from the list of dictionaries in the array from the plist in ViewController 1 and I want to change that key value that has "fav" to true from false from ViewController 2. I know it sounds a bit confusing so let me rephrase it. ViewController 1 has bunch of animals Dogs, Cats, Fish etc. So now if user clicks on Cats it takes them to viewcontroller 2 and on viewcontroller 2 I want a favorite button if user clicks on it it updates the Plist file and the boolean value in cats changes to true from false. I tried using userDefaults method and if I change the boolean value for one animal it changes for all animals. So I made another key value of Boolean in all animals in the plist. I want that Boolean Value to change when user hits the Favorite Button on ViewController 2 but it wont save to the plist file. </p>
  
  <p>Updated: So looking at my code I think the problems lies within ViewController 1. On ViewController 1 I wrote: </p>
  
  <pre><code>  let path = Bundle.main.path(forResource:"Animals", ofType: "plist")
    let dics = NSArray(contentsOfFile: path!) as! [NSMutableDictionary]
  
    self.orginalData = dics.map{Animals(Type: $0["Type"] as! String, Desc: $0["Desc"] as! String, fav: $0["fav"] as! Bool)}
  
    self.filteredData = self.original Data
  </code></pre>
  
  <p>then I show it on the tableview on ViewController 1 like this:</p>
  
  <pre><code>  func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
    if isFiltering() {
    searchFooter.setIsFilteringToShow(filteredItemCount: filteredData.count, 
    of: originalData.count)
    return filteredData.count
    }
  
     searchFooter.setNotFiltering()
     return originalData.count
    }
  
  
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
  
       let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath)
       var animals : Animals
       if isFiltering() {
           animals = filteredData[indexPath.row]
       } else {
           animals = originalData[indexPath.row]
       }
  
     cell.textLabel?.text = Animals.Type
    cell.detailTextLabel!.text = Animals.Desc
    return cell
    }
  </code></pre>