├── README.md ├── TodoMacro.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── sunnyxx.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── sunnyxx.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── TodoMacro.xcscheme │ └── xcschememanagement.plist └── TodoMacro ├── TodoMacro.h └── main.m /README.md: -------------------------------------------------------------------------------- 1 | # TodoMacro 2 | 3 | A todo macro demo project 4 | 5 | 6 | 7 | 8 | 详情请看我的博客:http://blog.sunnyxx.com/2015/03/01/todo-macro/ 9 | -------------------------------------------------------------------------------- /TodoMacro.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4845F2151AA433E60057F7A5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4845F2141AA433E60057F7A5 /* main.m */; }; 11 | 4845F21E1AA45EED0057F7A5 /* README.md in Sources */ = {isa = PBXBuildFile; fileRef = 4845F21D1AA45EED0057F7A5 /* README.md */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXCopyFilesBuildPhase section */ 15 | 4845F20F1AA433E60057F7A5 /* CopyFiles */ = { 16 | isa = PBXCopyFilesBuildPhase; 17 | buildActionMask = 2147483647; 18 | dstPath = /usr/share/man/man1/; 19 | dstSubfolderSpec = 0; 20 | files = ( 21 | ); 22 | runOnlyForDeploymentPostprocessing = 1; 23 | }; 24 | /* End PBXCopyFilesBuildPhase section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 4845F2111AA433E60057F7A5 /* TodoMacro */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TodoMacro; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 4845F2141AA433E60057F7A5 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29 | 4845F21C1AA45CB00057F7A5 /* TodoMacro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TodoMacro.h; sourceTree = ""; }; 30 | 4845F21D1AA45EED0057F7A5 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 31 | /* End PBXFileReference section */ 32 | 33 | /* Begin PBXFrameworksBuildPhase section */ 34 | 4845F20E1AA433E60057F7A5 /* Frameworks */ = { 35 | isa = PBXFrameworksBuildPhase; 36 | buildActionMask = 2147483647; 37 | files = ( 38 | ); 39 | runOnlyForDeploymentPostprocessing = 0; 40 | }; 41 | /* End PBXFrameworksBuildPhase section */ 42 | 43 | /* Begin PBXGroup section */ 44 | 4845F2081AA433E60057F7A5 = { 45 | isa = PBXGroup; 46 | children = ( 47 | 4845F21D1AA45EED0057F7A5 /* README.md */, 48 | 4845F2131AA433E60057F7A5 /* TodoMacro */, 49 | 4845F2121AA433E60057F7A5 /* Products */, 50 | ); 51 | sourceTree = ""; 52 | }; 53 | 4845F2121AA433E60057F7A5 /* Products */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | 4845F2111AA433E60057F7A5 /* TodoMacro */, 57 | ); 58 | name = Products; 59 | sourceTree = ""; 60 | }; 61 | 4845F2131AA433E60057F7A5 /* TodoMacro */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | 4845F21C1AA45CB00057F7A5 /* TodoMacro.h */, 65 | 4845F2141AA433E60057F7A5 /* main.m */, 66 | ); 67 | path = TodoMacro; 68 | sourceTree = ""; 69 | }; 70 | /* End PBXGroup section */ 71 | 72 | /* Begin PBXNativeTarget section */ 73 | 4845F2101AA433E60057F7A5 /* TodoMacro */ = { 74 | isa = PBXNativeTarget; 75 | buildConfigurationList = 4845F2181AA433E60057F7A5 /* Build configuration list for PBXNativeTarget "TodoMacro" */; 76 | buildPhases = ( 77 | 4845F20D1AA433E60057F7A5 /* Sources */, 78 | 4845F20E1AA433E60057F7A5 /* Frameworks */, 79 | 4845F20F1AA433E60057F7A5 /* CopyFiles */, 80 | ); 81 | buildRules = ( 82 | ); 83 | dependencies = ( 84 | ); 85 | name = TodoMacro; 86 | productName = TodoMacro; 87 | productReference = 4845F2111AA433E60057F7A5 /* TodoMacro */; 88 | productType = "com.apple.product-type.tool"; 89 | }; 90 | /* End PBXNativeTarget section */ 91 | 92 | /* Begin PBXProject section */ 93 | 4845F2091AA433E60057F7A5 /* Project object */ = { 94 | isa = PBXProject; 95 | attributes = { 96 | LastUpgradeCheck = 0610; 97 | ORGANIZATIONNAME = sunnyxx; 98 | TargetAttributes = { 99 | 4845F2101AA433E60057F7A5 = { 100 | CreatedOnToolsVersion = 6.1.1; 101 | }; 102 | }; 103 | }; 104 | buildConfigurationList = 4845F20C1AA433E60057F7A5 /* Build configuration list for PBXProject "TodoMacro" */; 105 | compatibilityVersion = "Xcode 3.2"; 106 | developmentRegion = English; 107 | hasScannedForEncodings = 0; 108 | knownRegions = ( 109 | en, 110 | ); 111 | mainGroup = 4845F2081AA433E60057F7A5; 112 | productRefGroup = 4845F2121AA433E60057F7A5 /* Products */; 113 | projectDirPath = ""; 114 | projectRoot = ""; 115 | targets = ( 116 | 4845F2101AA433E60057F7A5 /* TodoMacro */, 117 | ); 118 | }; 119 | /* End PBXProject section */ 120 | 121 | /* Begin PBXSourcesBuildPhase section */ 122 | 4845F20D1AA433E60057F7A5 /* Sources */ = { 123 | isa = PBXSourcesBuildPhase; 124 | buildActionMask = 2147483647; 125 | files = ( 126 | 4845F21E1AA45EED0057F7A5 /* README.md in Sources */, 127 | 4845F2151AA433E60057F7A5 /* main.m in Sources */, 128 | ); 129 | runOnlyForDeploymentPostprocessing = 0; 130 | }; 131 | /* End PBXSourcesBuildPhase section */ 132 | 133 | /* Begin XCBuildConfiguration section */ 134 | 4845F2161AA433E60057F7A5 /* Debug */ = { 135 | isa = XCBuildConfiguration; 136 | buildSettings = { 137 | ALWAYS_SEARCH_USER_PATHS = NO; 138 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 139 | CLANG_CXX_LIBRARY = "libc++"; 140 | CLANG_ENABLE_MODULES = YES; 141 | CLANG_ENABLE_OBJC_ARC = YES; 142 | CLANG_WARN_BOOL_CONVERSION = YES; 143 | CLANG_WARN_CONSTANT_CONVERSION = YES; 144 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 145 | CLANG_WARN_EMPTY_BODY = YES; 146 | CLANG_WARN_ENUM_CONVERSION = YES; 147 | CLANG_WARN_INT_CONVERSION = YES; 148 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 149 | CLANG_WARN_UNREACHABLE_CODE = YES; 150 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 151 | COPY_PHASE_STRIP = NO; 152 | ENABLE_STRICT_OBJC_MSGSEND = YES; 153 | GCC_C_LANGUAGE_STANDARD = gnu99; 154 | GCC_DYNAMIC_NO_PIC = NO; 155 | GCC_OPTIMIZATION_LEVEL = 0; 156 | GCC_PREPROCESSOR_DEFINITIONS = ( 157 | "DEBUG=1", 158 | "$(inherited)", 159 | ); 160 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 161 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 162 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 163 | GCC_WARN_UNDECLARED_SELECTOR = YES; 164 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 165 | GCC_WARN_UNUSED_FUNCTION = YES; 166 | GCC_WARN_UNUSED_VARIABLE = YES; 167 | MACOSX_DEPLOYMENT_TARGET = 10.10; 168 | MTL_ENABLE_DEBUG_INFO = YES; 169 | ONLY_ACTIVE_ARCH = YES; 170 | SDKROOT = macosx; 171 | }; 172 | name = Debug; 173 | }; 174 | 4845F2171AA433E60057F7A5 /* Release */ = { 175 | isa = XCBuildConfiguration; 176 | buildSettings = { 177 | ALWAYS_SEARCH_USER_PATHS = NO; 178 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 179 | CLANG_CXX_LIBRARY = "libc++"; 180 | CLANG_ENABLE_MODULES = YES; 181 | CLANG_ENABLE_OBJC_ARC = YES; 182 | CLANG_WARN_BOOL_CONVERSION = YES; 183 | CLANG_WARN_CONSTANT_CONVERSION = YES; 184 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 185 | CLANG_WARN_EMPTY_BODY = YES; 186 | CLANG_WARN_ENUM_CONVERSION = YES; 187 | CLANG_WARN_INT_CONVERSION = YES; 188 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 189 | CLANG_WARN_UNREACHABLE_CODE = YES; 190 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 191 | COPY_PHASE_STRIP = YES; 192 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 193 | ENABLE_NS_ASSERTIONS = NO; 194 | ENABLE_STRICT_OBJC_MSGSEND = YES; 195 | GCC_C_LANGUAGE_STANDARD = gnu99; 196 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 197 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 198 | GCC_WARN_UNDECLARED_SELECTOR = YES; 199 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 200 | GCC_WARN_UNUSED_FUNCTION = YES; 201 | GCC_WARN_UNUSED_VARIABLE = YES; 202 | MACOSX_DEPLOYMENT_TARGET = 10.10; 203 | MTL_ENABLE_DEBUG_INFO = NO; 204 | SDKROOT = macosx; 205 | }; 206 | name = Release; 207 | }; 208 | 4845F2191AA433E60057F7A5 /* Debug */ = { 209 | isa = XCBuildConfiguration; 210 | buildSettings = { 211 | PRODUCT_NAME = "$(TARGET_NAME)"; 212 | }; 213 | name = Debug; 214 | }; 215 | 4845F21A1AA433E60057F7A5 /* Release */ = { 216 | isa = XCBuildConfiguration; 217 | buildSettings = { 218 | PRODUCT_NAME = "$(TARGET_NAME)"; 219 | }; 220 | name = Release; 221 | }; 222 | /* End XCBuildConfiguration section */ 223 | 224 | /* Begin XCConfigurationList section */ 225 | 4845F20C1AA433E60057F7A5 /* Build configuration list for PBXProject "TodoMacro" */ = { 226 | isa = XCConfigurationList; 227 | buildConfigurations = ( 228 | 4845F2161AA433E60057F7A5 /* Debug */, 229 | 4845F2171AA433E60057F7A5 /* Release */, 230 | ); 231 | defaultConfigurationIsVisible = 0; 232 | defaultConfigurationName = Release; 233 | }; 234 | 4845F2181AA433E60057F7A5 /* Build configuration list for PBXNativeTarget "TodoMacro" */ = { 235 | isa = XCConfigurationList; 236 | buildConfigurations = ( 237 | 4845F2191AA433E60057F7A5 /* Debug */, 238 | 4845F21A1AA433E60057F7A5 /* Release */, 239 | ); 240 | defaultConfigurationIsVisible = 0; 241 | defaultConfigurationName = Release; 242 | }; 243 | /* End XCConfigurationList section */ 244 | }; 245 | rootObject = 4845F2091AA433E60057F7A5 /* Project object */; 246 | } 247 | -------------------------------------------------------------------------------- /TodoMacro.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TodoMacro.xcodeproj/project.xcworkspace/xcuserdata/sunnyxx.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunnyxx/TodoMacro/467cf3d3375c690a7ff9de328a1af09b7f1eab09/TodoMacro.xcodeproj/project.xcworkspace/xcuserdata/sunnyxx.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /TodoMacro.xcodeproj/xcuserdata/sunnyxx.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /TodoMacro.xcodeproj/xcuserdata/sunnyxx.xcuserdatad/xcschemes/TodoMacro.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /TodoMacro.xcodeproj/xcuserdata/sunnyxx.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | TodoMacro.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 4845F2101AA433E60057F7A5 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /TodoMacro/TodoMacro.h: -------------------------------------------------------------------------------- 1 | // 2 | // TODOMacro.h 3 | // TodoMacro 4 | // 5 | // Created by sunnyxx on 15/3/1. 6 | // Copyright (c) 2015年 sunnyxx. All rights reserved. 7 | // 8 | 9 | // 转成字符串 10 | #define STRINGIFY(S) #S 11 | // 需要解两次才解开的宏 12 | #define DEFER_STRINGIFY(S) STRINGIFY(S) 13 | 14 | #define PRAGMA_MESSAGE(MSG) _Pragma(STRINGIFY(message(MSG))) 15 | 16 | // 为warning增加更多信息 17 | #define FORMATTED_MESSAGE(MSG) "[TODO-" DEFER_STRINGIFY(__COUNTER__) "] " MSG " \n" DEFER_STRINGIFY(__FILE__) " line " DEFER_STRINGIFY(__LINE__) 18 | 19 | // 使宏前面可以加@ 20 | #define KEYWORDIFY try {} @catch (...) {} 21 | 22 | // 最终使用的宏 23 | #define TODO(MSG) KEYWORDIFY PRAGMA_MESSAGE(FORMATTED_MESSAGE(MSG)) 24 | -------------------------------------------------------------------------------- /TodoMacro/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TodoMacro 4 | // 5 | // Created by sunnyxx on 15/3/1. 6 | // Copyright (c) 2015年 sunnyxx. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TODOMacro.h" 11 | 12 | int main(int argc, const char * argv[]) { 13 | @autoreleasepool { 14 | @TODO("有些事,我都已忘记"); 15 | @TODO("但我现在还记得"); 16 | @TODO("那是一个晚上,我的母亲问我"); 17 | @TODO("今天怎~么~不开心?"); 18 | } 19 | return 0; 20 | } 21 | --------------------------------------------------------------------------------