FIXME & TODO And how to create build warnings.

Similar to the // Mark:, Apple has also provided us with two more markup properties (TODO and FIXME).  Like Mark these will show up in the jump bar, making it even easier to read. Add the following snippet to your project.

If you tap the jump bar you should now see the following

This is great, you can now see what needs to be done and what needs fixing by just tapping the jump bar. However, if you are like me you may have fixed the bug or completed the todo task or worse not actioned it at all and left the mark up in the code.

Now wouldn’t it be great if Xcode threw compiler warnings for whenever you have a TODO or FIXME in your syntax? Well, you can do just so by adding a simple build script.

To add a build script,

  • Click the project name in the project navigator
  • Select the target where you would want the script to run then
  • Click on build phases
  • Select the + symbol
  • Finally, click “New Run Script Phase”

Then add the following script

Your run script should look like this

Almost there!

Press command + b the build your project and the TODO’s and FIXME’s should appear in the issue navigator.