Closed mrlegowatch closed 2 months ago
Hmm. I'm stuck on how to overcome the Objective-C-compatible retrieveObject()
implementation's requirement for a non-nil return value, the compiler complains that it can't allow throwing and returning an optional, because Objective-C treats nil as an error. I am able to apply a fix for Swift retrieve<T>()
. Added unit tests to convey this difference in behavior.
The original ObjC design of singular
retrieveObject
supported returning nil if the object was not found, or an error, if, for example, decryption failed. The initial Swift 1.0.0 implementation sided with returning an error "object not found" instead of nil, which proved not as useful an implementation, since an object not yet saved will always initially be nil in the Garage.