Skip to content

Commit ca62cdb

Browse files
committed
ADD: add debug macro utils.
1 parent ebf1d9f commit ca62cdb

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

Macros/MacroUtils.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Author: Tang Qiao
2+
// Date: 2012-3-2
3+
//
4+
// The macro is inspired from:
5+
// http://www.yifeiyang.net/iphone-development-skills-of-the-debugging-chapter-2-save-the-log/
6+
#ifdef DEBUG
7+
#define debugLog(...) NSLog(__VA_ARGS__)
8+
#define debugMethod() NSLog(@"%s", __func__)
9+
#else
10+
#define debugLog(...)
11+
#define debugMethod()
12+
#endif
13+
14+
#define EMPTY_STRING @""
15+
16+
#define STR(key) NSLocalizedString(key, nil)

Macros/VersionCompare.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// Author: Tang Qiao
2+
// Date: 2012-3-2
3+
//
4+
// The macro is inspired from:
5+
// http://stackoverflow.com/questions/3339722/check-iphone-ios-version
6+
17
/*
28
* System Versioning Preprocessor Macros
39
*/
@@ -8,7 +14,7 @@
814
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
915

1016
/*
11-
* Usage sample:
17+
Usage sample:
1218
1319
if (SYSTEM_VERSION_LESS_THAN(@"4.0")) {
1420
...

0 commit comments

Comments
 (0)