With UTIs, it’s possible to integrate even further with the operating system, Spotlight, and Quick Look. It’s possible to publish a full description of the UTI—effectively injecting it into the tree and thus having the data type appear in Spotlight rules and more. However, this is beyond the scope of this book. Here are some exercises you can try on your own.
Depending on the application, it’s possible to reduce the metadata files dramatically. Since the importer (and the generator) can stand up the entire Core Data stack, it’s possible to just have the NSManaged-ObjectID (or even a unique identifier within the Recipe object) stored in the metadata file and have the importers and generators retrieve all the metadata information from the Core Data stack instead. (This is probably very similar to how Core Data does it internally.) This would also simplify the updating of the metadata, since the only action required at that point would be to delete metadata files for records that no longer exist. However, care must be taken with this approach because performance may suffer greatly.
You may have noticed that we ignored the Max Size setting of the Quick Look thumbnail generator. That was done for the sake of clarity, and in a production system we should be sizing down the image to accommodate that setting. By doing so, we’d be good citizens as well as help the performance of Quick Look whenever our files are involved.
When writing an application that uses a document model as opposed to a single repository, integrating Spotlight and Quick Look is even easier. Instead of having separate metadata files, we can simply store the relevant information in the metadata of the actual documents. This allows the importers to read the metadata without having to initialize the entire Core Data stack and still allows for very quick access to the relevant information.
Adding Spotlight and Quick Look integration into your desktop application gives it that bit of polish that subconsciously lets your users know they’re dealing with a finished product.
From here we’ll delve into a Core Data “Recipe” that deals with storing those “bits” of data that don’t quite fit into the normal data mold.
For more information on UTIs, I suggest reviewing http://developer.apple.com/library/ios/#documentation/general/conceptual/DevPedia-CocoaCore/UniformTypeIdentifier.html.