Display todo fixme and other tags in xcode4

Source: Internet
Author: User
    • Instructions
    • Bash script for "run script" build phase

In xcode 3, we can use annotations like this to easily mark the parts to be modified:

// Todo:
// Fixme:
//!!! :
//??? :

Xcode 4 does not support this function. There is a solution on the Internet to forward it:

Original article: http://deallocatedobjects.com/posts/show-todos-and-fixmes-as-warnings-in-xcode-4

Here's a neat little snippet for xcode 4 that will cause all of your// Todo:And// Fixme:Comments in your code to appear as compiler warnings when you build. Here's how to use it:

    • Enter the page for setting Project Properties
    • Select a target
    • Select build phases label
    • Click Add build phase in the lower right corner.
    • Show the run script in the column shown above and enter the following content
    • Head over to your project's item in the project navigator (usually at the very top)
    • Find your target in the list of targets on the left, select it
    • Head over to the "build phases" tab.
    • Click the "add build phase" in the bottom right of this screen.
    • In the editor that appears Insert the bash script shown below.

Now just build and you'll see all your// Todo:And// Fixme:Comments have become warnings. I love this technique, it might not be right for everyone, but hope it helps someone.

Bash script for "run script" build phase

KEYWORDS = "Todo: | fixme: | \? \? \? : | \! \! \! : "Find" $ {srcroot} "\ (-name "*. H "-or-name "*. M "\)-print0 | xargs-0 egrep -- With-filename -- line-number -- only-matching" ($ keywords ). * \ {1} quot; | Perl-p-e "s/($ keywords)/warning: \ $1 /"

You'll also be able to click on each of the warnings in the issue navigator to go right to the file and point in your code where you left the original// Todo:Or// Fixme:

Extra pro tip: Make sure you're using phrases to describe your// Todo:Comments like// Todo: handle this error gracefully, And things like that. The phrases will show up in the issues list beside each warning.

In this way, it can be displayed in the document item, and there will be a prompt in the compiled warning!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.