mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-14 07:33:28 +01:00
Printing all values in CoreStoreObject? #195
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cdelaet on GitHub (Jan 12, 2018).
Would it be possible to make
CoreStoreObjectto implementCustomStringConvertibleby default?It would be nice if
print(myCoreStoreObject)printed all keys and their values out of the box. I use that feature a lot to verify / debug my code.@Saklad5 commented on GitHub (May 6, 2020):
That’s not what
CustomStringConvertibleis for. You wantCustomReflectableorCustomDebugStringConvertible(I’m not sure why that last one exists).On a related note, Core Data documentation explicitly discourages overriding
descriptionto fire a fault. I implementTextOutputStreamableinstead. In fact, I never add conformance toCustomStringConvertibledirectly, only throughLosslessStringConvertible.TextOutputStreamableis more efficient, and takes priority for almost everything. It also doesn’t leave uselessly identical properties everywhere.