I've been working on an iOS app with UIDocuments
. They were saving fine. Now all of a sudden, after unrelated changes, nothing will save.
Here is the error printed in Xcode console:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL URLByAppendingPathExtension:]: component, components, or pathExtension cannot be nil.'
log.debug("save to:\(self.document.fileURL)")
document.save(to: document.fileURL, for: .forOverwriting) { success in
...
}
The log message there prints a valid URL.