How can I mark “To Do” comments in Xcode?

前端 未结 10 1164
别跟我提以往
别跟我提以往 2020-12-04 05:39

Currently I\'m working on an iOS based Image Manipulation task.

Problem:

I\'m working on different modules. So If I need to add something in a module in fu

相关标签:
10条回答
  • 2020-12-04 06:26
    #error
    

    and

    #warning
    

    are also used in C programming

    0 讨论(0)
  • 2020-12-04 06:29

    Using the

    //TODO: some thing here
    

    works if all you want to do is to look at the list of todos in the drop down

    If you want to be intrusive you can use #warning marks instead:

    #warning this will create a compiler warning.
    

    And when you build the app you will get a compiler warning (a yellow triangle, not a compiler error) which is a little more "in your face" about reminding you of things you need to do.

    0 讨论(0)
  • 2020-12-04 06:32
    // TODO: the thing todo
    

    Is how you show todo tasks.

    0 讨论(0)
  • 2020-12-04 06:33

    I split up the recognized tokens into Warnings and Errors for my own use, thought I would share it here:

    KEYWORDS="STUB:|WARNING:|TODO:|FIXME:|DevTeam:|\?\?\?:" 
    find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -not -path "${SRCROOT}/Pods/*" -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/1: warning: \$1/"
    
    KEYWORDS="ERROR:|XXX:|\!\!\!:" 
    find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -not -path "${SRCROOT}/Pods/*" -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/1: error: \$1/"
    ERROR_OUTPUT=`find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -not -path "${SRCROOT}/Pods/*" -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/1: error: \$1/"`
    
    exit ${#ERROR_OUTPUT}
    
    0 讨论(0)
提交回复
热议问题