Ich bin neu bei CORE DATA in meiner App Ich verwende Coredata. Ich habe nur Daten in meinen Kerndaten gespeichert. Der Name meiner Entität lautet "FEED" und ich habe eine Zeile mit dem Namen "title", "id", "link", "desc". Jetzt möchte ich die Zeile basierend auf "id" löschen. also wie kann ich das tun?Wie lösche ich eine Zeile aus coredata (Entity) ios swift
Hier ist mein Code,
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell : MessageMusicCell = tableView.dequeueReusableCellWithIdentifier("MessageMusicCell") as! MessageMusicCell
cell.pinButton.tag = indexPath.row
cell.pinButton.addTarget(self, action: #selector(MessageViewController.buttonDeletePressed(_:)), forControlEvents: UIControlEvents.TouchUpInside)
cell.selectionStyle = .None
person = people[indexPath.row]
cell.lbl_title_msg_music.text = person!.valueForKey("title") as? String
cell.img_message_music.image = UIImage(named: "PlaceHolder")
cell.desc_msg_music.text = person!.valueForKey("desc") as? String
return cell
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
print(people.count)
return people.count
}
func buttonDeletePressed(sender:UIButton) {
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let cell : MessageMusicCell = tableView.dequeueReusableCellWithIdentifier("MessageMusicCell") as! MessageMusicCell
}
so, wie ich dies tun kann?
funktioniert es Danke –
Sie sind willkommen ....! –