title: Multiple entries into tableView
body: <p>I have a problem with entering multiple Attributes to my tableView. It just keeps on displaying the very last attribute. Diabetes is the only one, which I can display in the tableView.
  How do I edit the code, so that TableView displays all 4?</p>
  
  <p>Instead of all four, that I need. I created the attributes in core data and will try to store them into SQLite. But this is not the first entity that I created. Do I need to something different, when I try to access another entity from core data?
  Maybe you can help me out 
  Thanks a million and happy Christmas </p>
  
  <pre><code>// MARK: - Table view data source
  
  override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return itemArray2.count
  
  }
  
  override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
  
      let cell = tableView.dequeueReusableCell(withIdentifier: "GPDCell", for: indexPath)
  
      let item = itemArray2[indexPath.row]
  
      cell.textLabel?.text = item.name
      cell.textLabel?.text = item.age
      cell.textLabel?.text = item.bmi
      cell.textLabel?.text = item.diabetes 
  
      return cell
  </code></pre>
  
  <p>}</p>
  
  <pre><code>@IBAction func AddPatientData(_ sender: UIBarButtonItem) {
  
      var textField = UITextField()
  
      let alert = UIAlertController(title: "Add Patient Data", message: "", preferredStyle: .alert)
      let action = UIAlertAction(title: "Add Data", style: .default) { (action) in
  
  
  
  
          let newItem = ItemPatient(context: self.context)
  
  
          newItem.name = textField.text!
          newItem.age = textField.text!
          newItem.bmi = textField.text!
          [enter image description here][1]newItem.diabities = [enter image description here][1]textField.text!
  
  
  
          self.itemArray2.append(newItem)
  
  
          self.saveItems()
  
      }
  
      alert.addTextField { (alertTextField) in
          alertTextField.placeholder = "Add Patient Name"
          print(alertTextField)
          textField = alertTextField
      }
  
      alert.addTextField { (ageTextField) in
          ageTextField.placeholder = "Add Patients Age"
          print(ageTextField.text)
          textField = ageTextField
  
      }
      alert.addTextField { (bmiTextField) in
          bmiTextField.placeholder = "Add Patients BMI"
          print(bmiTextField.text)
          textField = bmiTextField
  
  
      }
  
      alert.addTextField { (diaTextField) in
          diaTextField.placeholder = "Diabieties"
          print(diaTextField.text)
          textField = diaTextField
  
      }
  
      alert.addAction(action)
      present(alert, animated: true, completion: nil)
  
  }
  
  
      func saveItems (){
  
          do{
              try context.save()
          }catch{
              print ("Error saving context \(error)")
          }
  
          self.tableView.reloadData()
  </code></pre>
  
  <p>}</p>
  
  <pre><code>    func loaditems (with request:NSFetchRequest&lt;ItemPatient&gt; = ItemPatient.fetchRequest() ){
  
          do{
              itemArray2 = try context.fetch(request)
          }catch{
              print("Error fetching data \(error)")
          }
  
          tableView.reloadData()
  </code></pre>