Skip to content

App Crashes when using observable #349

@firecrackerz

Description

@firecrackerz

What

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'An instance of NSFetchedResultsController requires a fetch request with sort descriptors'

Context

let request : FetchRequest<DataObject> = FetchRequest<DataObject>()
    
                self.observable = db.observable(request: request)
                
                pedometerDataObservable.observe { (changes) in
                    switch changes {

                    case .initial(let objects):
                        print("\(objects.count) objects in the database")
                    case .update(let deletions, let insertions, let modifications):
                        print("\(deletions.count) deleted | \(insertions.count) inserted | \(modifications.count) modified")
                    case .error(let error):
                        print("Something went wrong", error.localizedDescription)
                    }
                }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions