title: Errors when adding a cell from Custom Table View
body: <p>This is my TableViewController which should add the cells to the screen</p>
  
  <pre><code>import UIKit
  
  class categoryTableViewController: UITableViewController {
  var selectedItem = ""
  var selectedIndex: Int = 0
  
  
  var items = [[dataClass]]()
  
  //Double array of the shopping item Make new swift for data classes
  override func viewDidLoad() {
      super.viewDidLoad()
      items=[
          [dataClass(image: UIImage(named: "grocery-1-tomatoes")!, header: "Tomatoes", price:5, description:"lsdfjsdnfsjdf"),
           dataClass(image: UIImage(named: "grocery-2-bananas")!, header: "bananas", price:5, description:"lsdfjsdnfsjdf"),
           dataClass(image: UIImage(named: "grocery-3-gala")!, header: "gala", price:5, description:"lajsdljasd"),
           dataClass(image: UIImage(named: "grocery-4-lettuce")!, header: "lettuce", price:5, description:"lajsdljasd"),
           dataClass(image: UIImage(named: "grocery-5-broccoli")!, header: "broccoli", price:5, description:"lajsdljasd"),
           dataClass(image: UIImage(named: "grocery-6-milk")!, header: "milk", price:5, description:"lajsdljasd"),
           dataClass(image: UIImage(named: "grocery-7-bread")!, header: "bread", price:5, description:"lajsdljasd"),
           dataClass(image: UIImage(named: "grocery-8-eggs")!, header: "eggs", price:5, description:"lajsdljasd")
          ],
  
          [dataClass(image: UIImage(named: "garden-1-shovel")!, header: "shovel", price:53, description:"lsdfjsdnfsjdf"),
           dataClass(image: UIImage(named: "garden-2-tomato-plant")!, header: "Tomato Plant", price:5, description:"lsdfjsdnfsjdf"),
           dataClass(image: UIImage(named: "garden-3-mower")!, header: "mower", price:5, description:"lsdfjsdnfsjdf")
          ]
      ]
      tableView.dataSource = self
      tableView.delegate = self
      print(selectedItem)
      print(selectedIndex)
  
  }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  
  // MARK: - Table view data source
  
  override func numberOfSections(in tableView: UITableView) -&gt; Int {
      return 1
  }
  
  override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      // #warning Incomplete implementation, return the number of rows
  
      return items[selectedIndex].count
  }
  
  override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      let cell = tableView.dequeueReusableCell(withIdentifier: "categoryView", for: indexPath) as! customTableViewCell
  
      cell.categoryImageView = UIImageView(image: items[selectedIndex][indexPath.row].categoryImageView) 
   //right here I get the error type dataClass has no subscript members
      cell.categoryNameLabel = UILabel(header: items[selectedIndex][indexPath.row].categoryLabel)
  //right here I get the error value of type 'inout [[dataClass]]' (aka 'inout Array &lt;array&lt;dataClass&gt;&gt;')
      cell.categoryDescriptionLabel = UILabel(description: items[selectedIndex][indexPath.row].categoryDescription)
  //right here I get the error value of type 'inout [[dataClass]]' (aka 'inout Array &lt;array&lt;dataClass&gt;&gt;')
  
      return cell
  
  }
  }
  </code></pre>
  
  <p>This is my customTableViewCell Class
      import UIKit</p>
  
  <pre><code>class customTableViewCell: UITableViewCell {
  
  @IBOutlet weak var categoryPriceLabel: UILabel!
  @IBOutlet weak var categoryImageView: UIImageView?
  @IBOutlet weak var categoryDescriptionLabel: UILabel!
  @IBOutlet weak var categoryNameLabel: UILabel!
  
  override func awakeFromNib() {
      super.awakeFromNib()
      // Initialization code
  }
  
  override func setSelected(_ selected: Bool, animated: Bool) {
      super.setSelected(selected, animated: animated)
      // Configure the view for the selected state
  }
  
  }
  </code></pre>
  
  <p>and this is my dataClass
      import UIKit</p>
  
  <pre><code>class dataClass{
  
  var categoryImage: UIImage
  var categoryLabel: String
  var categoryPrice: Int
  var categoryDescription: String
  init(image: UIImage, header: String, price:Int, description:String){
      self.categoryImage = image
      self.categoryLabel = header
      self.categoryPrice = price
      self.categoryDescription = description
  }
  }
  </code></pre>
  
  <p>I am trying to add different categories into the page programmatically but I have no idea how to fix those errors. </p>