I have the following code:
func saveContext () {
var error: NSError? = nil
let managedObjectContext = self.managedObjectContext
if managedObjectContext != nil {
if managedObjectContext.hasChanges && !managedObjectContext.save(){
abort()
}
}
}
I got two errors: call can throw, but not marked with try and the error is not handled. The other one says cannot convert value of type () to expected argument type 'Bool'.
How can I fix this?
[swift] call can throw, but not marked with try... - Martin R