I am trying to create a note pad in Xcode with core data but I am hitting a wall when I create the table view.
The error is at the code: noteCell.titleLabel.text = thisNote.title
The error is :Value of type 'UITableView' has no member 'text'
var noteList = [Note]()
class NoteTableView: UITableViewController
{
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
{
var noteCell = tableView.dequeueReusableCell(withIdentifier: "noteCellID", for: indexPath) as! NoteCell
let thisNote: Note!
thisNote = noteList[indexPath.row]
noteCell.titleLabel.text = thisNote.title
noteCell.descriptionLabel.text = thisNote.desc
return noteCell
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
{
return noteList.count
}
override func viewDidAppear(_ animated: Bool) {
tableView.reloadData()
}
}
The noteCell is defined as follows.
class NoteCell: UITableViewCell
{
@IBOutlet var titleLabel: UITableView!
@IBOutlet var descriptionLabel: UITableView!
}
The core date is defined as follows:
import CoreData
@objc(Note)
class Note: NSManagedObject
{
@NSManaged var id: NSNumber!
@NSManaged var title: String?
@NSManaged var desc: String?
@NSManaged var deletedDate: Date?
}
Thank you!