Thanks for the links. All I was looking for is how to make find/replace work with a basic NSTextView. As I was reading the docs on NSTextFInder, I thought I needed to set up the dependencies between my NSTextVIew, NSTExtFinder, and NSTextFinderClient, and I was lost on how exactly this needed to be done.
But as it turns out, all I have to do is to set textView.usesFindBar = true. And of course, add menu items with another one-liner TextEditingCommands(). This is amazing. Thank you Apple ))
Post
Replies
Boosts
Views
Activity
Ah, I think I see where you're coming from. I'm not solving a problem of storing any random document in a sqlite database. My document is a structured collection of data elements represented as a JSON, and a link to a sqlite data store is one of those data elements.
Indeed, in my app I use the default path for the model (it's in the app bundle) and sqlite data stores (file:///Users//Library/Application%20Support//.sqlite) that Core Data library provides for both a newly created data store and existing ones. Cloud Drive and stuff - this is a prerogative of CloudKit, which I am yet to learn.
There is also a Core Data API that lets you specify the exact path and file name. But I'm not using it in my app because I'm fine with the default location of the sqlite data files - I'm only using it for caching.
Yeah, I got it to work, please see my answer above (flagged with a green check mark).
As for linking ReferenceFileDocument to a CoreData store, that wasn't a problem, I just store the database name in my model instance and serialize it as a JSON.
When I open an existing document, I pass the database name into NSpersistentContainer constructor.