Plugins for XCode

I’m very happy that there’s a good way to use all the vim stuff within XCode. I’ve been using it for quite a while, and there was nothing I couldn’t do, but I’m also not a super advanced user.

XVim for XCode

I recommend building it from the github repo. As of right now, the current version has a crash bug in it.

Since this post is really about plugins / extensions, I recommend downloading Alcatraz. Alcatraz has quite a few extensions including VVDocumenter, which helps to produce doxygen and appledoc compliant comments. You can change themes, and other useful stuff to make working with XCode suck less.

Intro to boost::signal

boost::signal is the C++ equivalent to a C# delegate. Actually, make sure you’re using boost::signal2, boost::signal is deprecated.

It’s a little confusing at first, but I use the following “template” code below whenever I need to use them. Using a signal requires you have a few things set up. 1) A function that is called by the signal. 2) The signal to call the function. 3) Registering the function with the signal (the slot). 4) Firing the signal. I will show you this through the interaction between two classes.

Register the callback signal handler function.

You can, of course, change the parameters and types to your liking. But you’ll have to figure out how to use boost::bind to do so. See below for the definition of “RegisterSignalHandler”.

Creating the signal.

SignalType is just something to make the code easier to read. We really need two functions, one to fire the signal (if we want to do it this way) and one to register the signal handler. “RegisterSignalHandler” is merely called when you want to register a signal handler to be called when the signal is fired.

Creating the function to fire the signal.

Really any function that has access to “signal_” can fire the signal. In this case, I fire the signal passing in true the first call, and false the second. This calls all functions that have been “registered” (in the order in which they were registered).

Creating the registration function.