Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR GRAPH CANCEL ROW IN LIST #164

Open
schulz89sp opened this issue Dec 9, 2019 · 7 comments
Open

ERROR GRAPH CANCEL ROW IN LIST #164

schulz89sp opened this issue Dec 9, 2019 · 7 comments

Comments

@schulz89sp
Copy link

schulz89sp commented Dec 9, 2019

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

@daniel-jonathan
Copy link
Member

@schulz89sp when did this error occur, what has changed since before this error? What device are you using to test this, and what is your Graph version and OS?

@schulz89sp
Copy link
Author

Using the latest version of xCode and the latest version of Graph, to try using the simulator, however, to program swiftUI use...

@OrkhanAlikhanov
Copy link
Contributor

It's hard to guess what went wrong. Can you please provide a minimal sample that reproduces the issue?

@schulz89sp
Copy link
Author

If you create any entity with 2 properties: id and title both strings then in the swiftUI controller create a list that has all the titles inside it and try to delete one at random by passing the ID as the value of the selected cell obtained the error...
If you want to give me an email I send you an example!

@daniel-jonathan
Copy link
Member

daniel-jonathan commented Dec 12, 2019

@schulz89sp Hi, we want to help you, but to save time, please provide a sample that demonstrates the issue. Thank you!

@schulz89sp
Copy link
Author

Prova.zip

@schulz89sp
Copy link
Author

News? seen the example?

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

No branches or pull requests

4 participants