title: How can I get an array to an NSManagedObject
body: <p>I am sorry if I put out silly questions but I am new to Swift. I am building an app and so far it goes quite well. But now I want to delete some rows from my tableview which gets feeded from an Array with Strings. And then I want to save/fetch that using core data. I believe I have the code for it but the problem is that I am trying to save an array full of Strings. so I get error message saying: Cannot convert value of type 'String' to expected argument type 'NSManagedObject'. And therefore I am wondering, how can I solve this? Is there any way to "add those Strings to an NSManagedObject somehow?</p>
  
  <p>Here are my code:</p>
  
  <p>the array :
  <a href="https://i.stack.imgur.com/fQyeE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fQyeE.png" alt="enter image description here"></a></p>
  
  <p>and here are the code:</p>
  
  <pre><code>import UIKit
  import CoreData
  
  
  
  
  class tableViewController: UIViewController, UITableViewDelegate, UITableViewDataSource{
  func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return (List.count)
  
  }
  
  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt;     UITableViewCell {
      let cell = UITableViewCell(style: .default, reuseIdentifier: "cell")
      cell.textLabel?.text = List.self[indexPath.row]
      cell.textLabel?.textColor = UIColor.white
      cell.backgroundColor = UIColor.clear
  
  
  
  
      return(cell)
  
  }
  
      func tableView(_ tableView: UITableView, commit editingStyle:     UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
  
          let context = (UIApplication.shared.delegate as!     AppDelegate).persistentContainer.viewContext
  
          if editingStyle == .delete{
              let rows = List[indexPath.row]
              context.delete(rows)
              (UIApplication.shared.delegate as! AppDelegate).saveContext()
  
              do{
                  List = try context.fetch(MealsMenu.fetchRequest()) as! [String]
              }
              catch{
                  print(error)
              }
          }
          myTableView.reloadData()
  
  }
  
  
  
  
  
  @IBOutlet weak var myTableView: UITableView!
  
  override func viewDidAppear(_ animated: Bool) {
      myTableView.reloadData()
  }
  
  override func viewDidLoad() {
      super.viewDidLoad()
      CoredataClass.saveItems()
      CoredataClass.loadData()
  }
  
  }
  </code></pre>