title: Could not cast value of type 'NSTaggedPointerString' to an array
body: <p>I working on a project that is written in <code>swift 3.0</code>. My requirement is to save data that i enter on some text fields and populate one of those attributes in to a table view, and once a row is selected I wants to update that records (re-assign values on my text fields).</p>
  
  <p>However im having an issue with my code when i try to fetch data that i have saved in <strong><code>core data</code></strong> and assigning them in to an array. Basically I have an entity named "<strong>Task</strong>" and it got three attributes, and since i wants to populate one of those attributes(called "name") that i have saved on core data, to a table view i have written the code as follow. But im getting an exception in the following line in my code saying "<code>Could not cast value of type NSTaggedPointerString (0x10d8f7b90) to NSArray (0x10d8f7c58)</code>". </p>
  
  <p><strong>The error line and the code as bellow.<br></strong></p>
  
  <pre><code> tasks += expName as! [Task] 
  </code></pre>
  
  <p><strong>Here is my full code:</strong>   </p>
  
  <pre><code>import UIKit
  import CoreData
  
  class TableViewController: UIViewController,UITableViewDelegate,UITableViewDataSource {
  
  @IBOutlet weak var tableView: UITableView!
  
  let appDelegate : AppDelegate = UIApplication.shared.delegate as! AppDelegate
  let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext
  
  var tasks = [Task] ()
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      // Do any additional setup after loading the view.
  }
  
  override func viewDidAppear(_ animated: Bool) {
  
      //var error : NSError?
      let request = NSFetchRequest &lt;NSFetchRequestResult&gt; (entityName: "Task")
      request.returnsObjectsAsFaults = false 
      do {
  
          let results = try context.fetch(request)
          // check data existance
          if results.count&gt;0 {
              print(results.count)
  
              for resultGot in results as! [NSManagedObject]{
  
                  if let expName = resultGot.value(forKey:"name"){
                      print("expence name is :", expName)
                      tasks += expName as! [Task]      
                      print("my array is : \(tasks)")
                  }
              }    
          }    
      }catch{  
          print("No Data to load")
      }
      self.tableView.reloadData()
   }
   override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  
   func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
     let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
      cell.textLabel?.text = tasks [indexPath.row] as? String
      return cell
   }
  
   func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return tasks.count
   }
  
   override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
      if segue.identifier == "ShowEditTask"{
       let v = segue.destination as! ViewController
          let indexPath = self.tableView.indexPathForSelectedRow
          let row = indexPath?.row
  
  
      }
   }
  </code></pre>