Core Data Lab 1.1: Cached object models, and much more
April 20, 2020 — by Ron Elemans
Version 1.1 of Core Data Lab contains a mix of some new ‘must-have’ features, some fixes to cover exotic Core Data ‘use cases’, and new features that wouldn’t exist without the feedback of a few seasoned Core Data developers.
New features
The following features are new in Core Data Lab 1.1:
- Object creation functions: the Data menu has been extended with a ’New Object’ menu item to add new objects for the selected entity, and a ’New Related Object’ menu item to add new objects for the selected Core Data relationship.
- Core Data Model Cache option: the Core Data Object Model that’s cached in the database can now be used as object model in a Core Data Lab project. This is especially useful for developers that generates their object models during runtime (yes, they do really exist!) or when you want to investigate a database without having access to the corresponding compiled object model. Disclaimer: if you have a model file, it’s still better to use that in your project. The existence and actuality of a model cache in the database is not guaranteed. Also the implementation can change at any moment. This feature is supported on macOS 10.15 or newer.
- Multi-select option: you can now enable multi-select for table views in the app’s Preferences. This is useful when you want to delete of export sub-selections.
- Tab navigation support in main, tab and detail windows. Navigate from field to field by hitting the Tab key on your keyboard. Or back, by using Space + Tab.
- Navigation menu items and shortcuts to move focus to the next panel. Together with the enhanced tab key support and the existing short cut keys, you can now edit and create data without touching your mouse.
- Auto repair simulator projects: database and app paths of Core Data Lab projects based on apps running in a simulator environment are now automatically repaired if needed, when you open the project or start a new data change tracking session. This is quite useful, because every time your run a new debug session in Xcode, the GUID-named folders, containing the app binary and app data, changes. The auto repair behavior can be controlled via a new setting Auto repair simulator projects in the Advanced section of the Core Data Lab Preferences.
- Panel layout persistence: visibility and sizes of all panels of the document window are now saved in the project document file and restored when opening a project. This feature is supported on macOS 10.15 or newer.
- New columns in Simulator browser: by using the context menu on the column headers in the Simulator browser, you can now add Display name and Bundle identifier to the default column set. These adjustments are stored as app preferences.
- Database extensions setting: database extensions used for selecting and finding databases are now adjustable in the Preferences. Can also be set to no extension at all, which is by the way not a very efficient choice when searching for a database on a large hard-disk.
Improvements
The following improvements have been made in Core Data Lab 1.1:
- Added support for displaying and editing URI attribute type fields.
- Added support for displaying and regenerating the content of UUID attribute type fields.
- When searching for databases, it's now possible to search within packages by disabling a new setting Skip packages. This is default enabled, but if you need to search for databases within packages like certain NSDocument files, you can now do that.
- Added support for using iOS 13 or macOS 10.15 Core Data models and databases in macOS 10.14. A warning is being shown when the data model contains features that are not supported on the local macOS version, such as NSDerivedAttributeDescription. This will be prohibited to prevent uncatchable crashes.
- Added column Preserve in Entity Description inspector representing Core Data attribute setting preservesValueInHistoryOnDeletion.
- Added a menu item Show Model in Finder under menu Project to show the compiled Core Data Object Model file in the Finder.
- The content preview panel is now able to detect and display binary data with HEIC images.
- The NSMergePolicy of the NSManagedObjectContext used in the Core Data Lab project can now be set in the Project settings. You can open the Project settings via menu File or by clicking on the model name in the status panel on the toolbar.
- The default setting for merge policy in a Core Data Lab project has been changed from NSMergeByPropertyObjectTrumpMergePolicy to NSErrorMergePolicy.
- Improved display of NSConstraintConflict errors when saving new or changed data.
- Opening databases via the Finder has been improved, the read-only setting and model cache preference are now both correctly implemented.
- Added support for deleting objects displayed in the Relationships panel.
- Added basic detection for deleting source files while the project document is opened.
Fixes
The following issues have been fixed in Core Data Lab 1.1:
- Binary fields with Allows External Storage enabled, are now only loaded and displayed when the database folder is accessible, to prevent uncatchable crashes. Otherwise a directory access dialog is being presented, to move the access token stored in the project to a higher directory level.
- Fixed display of iPhone 11 devices in the Simulator browser.
- Hidden panels are now no longer loaded while browsing data.