Database Reference
In-Depth Information
a
UTI
that is being handled by our application. Since this
UTI
is unknown by
the system, we need to describe it, again in our
Info.plist
file.
<dict>
<key>
UTTypeConformsTo
</key>
<array>
<string>
public.data
</string>
<string>
public.content
</string>
</array>
<key>
UTTypeDescription
</key>
<string>
Grokking Recipe
</string>
<key>
UTTypeIdentifier
</key>
<string>
com.pragprog.grokkingrecipe
</string>
<key>
UTTypeTagSpecification
</key>
<dict>
<key>
public.filename-extension
</key>
<string>
grokkingrecipe
</string>
</dict>
</dict>
</array>
This key describes exporting our
UTI
and tells Mac OS X how to link it to dif-
ferent file extensions. In addition, this section describes the data to Mac OS
X, telling the OS a descriptive name for the data type and where in the
UTI
tree it fits.
1
Xcode Subproject
Our Spotlight importer is actually its own application. Xcode handles this
with a separate project for the importer. (It is actually possible to include the
plug-in as part of the main application project, but I have found that to be
more hassle than it is worth.) Since we want to include the importer as part
of our primary application and we do not want to have to remember to rebuild
the subproject every time we build our main project, we will set it up as a
dependent or subproject within our primary project. To do this, we start with
creating a project in Xcode and selecting the Spotlight importer, as shown in
Figure 36,
Select the Spotlight template
, on page 164
.
We want to save this project in a directory inside our primary recipe project,
and we don't want to be too clever. We'll give the subproject an obvious name
like
SpotlightPlugin
and include it with the
Spotlight
example project. To make
1.