I need help deleting a row in core data
outline:
i have a table view which gets populated from a form which asks a user to input details about a friend.
The user needs an option to delete a friend from the list. when a user clicks on a row from the table view i need to access the string to get the ID and then query the core data for that ID and then delete it.
I am stuck on accessing the data the user clicks on and getting the ID
this is what a friend in the table view looks like
12345 James Bond 19 Male Sydney ICT
where 12345 is a unique student number
this is my function to remove a friend from core data
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
tableView.delegate = self
tableView.dataSource = self
let appDelegate = UIApplication.shared.delegate as! AppDelegate
friends = appDelegate.getFriendInfo()
self.tableView.rowHeight = 33.0
}
}
I am having difficulties getting the ID within the row and then deleting that row from core data