Development notes

This page lists some assorted notes I accumulated while writing the Email Address Sort Service.

Bibliography

Things that were not obvious

  • My road to the correct project/build type for a stand-alone service (as opposed to an application that does its own thing and provides a subset of its functionality as a service) was a bit convoluted. I started by creating a "Foundation Tool" project from the "Command Line Utility" category of projects under Xcode 3, but wound up needing to create an application build target within the project to get things working. A strict command-line tool doesn't work because it's not a bundle and you can't add an Info.plist file to it; similarly, a "loadable bundle" doesn't quite work since (for reasons that aren't entirely clear to me) the executable inside the bundle doesn't run as expected.
  • There appears to be a bug in Xcode where, when editing the Info.plist file to add the requisite service-identifying keys, the editor transposes the "human-readable" version of the plist key with the "raw" version. Specifically, when creating the menu item entry for the service, Xcode (at least 3.1.1) generates the "raw" key as "Menu item title" and the "human-readable" key as "default". These should be switched; this can be done by editing the Info.plist file directly or by switching to raw key/value editing mode and changing the key to "default".
  • OCUnit is now built into Xcode. To actually run the unit tests, all you need to do is build the OCUnit target.
  • Somehow, the OS was much more interested in the service bundle in my project build directory than in the one I actually installed in /Library/Services. I had to clean my build directory, log out, and log back in to make it find the right one. Even now, I'm not sure it would prefer the one in /Library/Services over the one in my build directory.