title: Swift3 error : Type 'NSFastEnumerationIterator.Element' (aka 'Any') does not conform to protocol 'AnyObject'
body: <p>So, I'm trying to update my toDo list app to swift 3 / iOS 10, but I came across this error when updating. I have looked up the internet and StackOverflow and found that someone else also sort of had this problem, but the solution there, didn't help for me.
  This is just one file, that takes care of inserting into Core Data.</p>
  
  <p>This is the code for that file :</p>
  
  <pre><code>import UIKit
  import CoreData
  
  var taskMgr: TaskManager = TaskManager()
  
  struct task {
      var name = "not defined"
      var desc = "not defined"
  }
  
  class TaskManager: NSObject {
    var tasks = [task]()
    var persistenceHelper: PersistenceHelper = PersistenceHelper()
  
    override init(){
  
      let tempTasks:NSArray = persistenceHelper.list(entity: "Task")
      for res:AnyObject in tempTasks{
          tasks.append(task(name:res.valueForKey("name")as! String,desc:res.valueForKey("desc") as! String))
      }
    }
  
  
    func addTask(name:String, desc: String){
  
      var dicTask: Dictionary&lt;String, String&gt; = Dictionary&lt;String,String&gt;()
      dicTask["name"] = name
      dicTask["desc"] = desc
  
      if(persistenceHelper.save(entity: "Task", parameters: dicTask)){
          tasks.append(task(name: name, desc: desc))
      }
    }
  
    func removeTask(index:Int){
      let value:String = tasks[index].name 
  
      if(persistenceHelper.remove(entity: "Task", key: "name", value: value)){
          tasks.remove(at: index)
      }
    }
  
  }
  </code></pre>
  
  <p>So it gives an error on line 18 which go's like this : </p>
  
  <blockquote>
    <blockquote>
      <p>Type 'NSFastEnumerationIterator.Element' (aka 'Any') does not conform to protocol 'AnyObject'</p>
    </blockquote>
  </blockquote>
  
  <p>Can anyone help me?
  Thanks :)</p>