Closed aiosDeveloper closed 5 years ago
If you are observing an object that gets deleted you get ab error
yes, thanks! but what we can do to solve this error? i need to observe an object and delete it when user loged out
Maybe just mark the record as logged out, get the update, and then delete it.
how I can delete the record that was observe by UI objects?!
Observable.from(object: profileInDb) .map { profile -> UIImage in let avatar = self.imageStorageHandler.loadImageFromPath(profile.avatarDir) return avatar ?? #imageLiteral(resourceName: "test") } .bind(to: self.userImage.rx.image)
This repo's issues are more about technical issues with the library - I suggest to open a Stack Overflow question or post a question on RxSwift's slack: http://slack.rxswift.org
When I attempt to clean my db, this error was shown! "objectDeleted"
I use observer from this object in different place of my code.
this function in RXCocoa.swift call error: `// MARK: Shared with RxSwift
func rxFatalError(_ lastMessage: String) -> Never { // The temptation to comment this line is great, but please don't, it's for your own good. The choice is yours. fatalError(lastMessage)
} `
this is my code: `func logout(){ //clean db DBManager.sharedInstance.deleteAllFromDatabase() }
func deleteAllFromDatabase() { try! database.write { database.deleteAll() print("Deleted All Profile objects") } } `