Skip to content

ERROR GRAPH CANCEL ROW IN LIST #164

Description

@schulz89sp
func cancella(at offset: IndexSet) {
        guard let intindex = Array(offset).first else { return }
        let id = dm.Storage[intindex].properties["id"] as? String ?? ""
        DataManager.Shared.cancellaPosto(id)
    }

func cancellaPosto(_ ID: String) {
        let operazioneSearch = Search<Entity>(graph: DB).where(.type("Posti") && "id" == ID)
        let operazione =  operazioneSearch.sync(completion: nil)
        
        if let opeDaCanc = operazione.first {
            opeDaCanc.delete()
            if let index = Storage.firstIndex(of: opeDaCanc) {
                self.Storage.remove(at: index)
                self.objectWillChange.send()
            }
        }

        DB.async {(Bool, error) in
            if let e = error {
                print(e.localizedDescription)
            }
        }
    }

Fatal error: [Graph Error: Cannot obtain permanent objectID]: file /Users/schulz/Desktop/POI MapNote/POI MapNote/Graph/ManagedNode.swift, line 40
2019-12-09 15:53:14.847221+0100 Simple List[48128:2685330] Fatal error: [Graph Error: Cannot obtain permanent objectID]: file /Users/schulz/Desktop/POI MapNote/POI MapNote/Graph/ManagedNode.swift, line 40

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions