全局項目宏
/*** 如果希望某些內容能拷貝到任何源代碼文件(OC\C\C++等), 那么就不要寫在#ifdef __OBJC__和#endif之間 ***/
/***** 在#ifdef __OBJC__和#endif之間的內容, 只會拷貝到OC源代碼文件中, 不會拷貝到其他語言的源代碼文件中 *****/
#ifdef __OBJC__
/***** 在#ifdef __OBJC__和#endif之間的內容, 只會拷貝到OC源代碼文件中, 不會拷貝到其他語言的源代碼文件中 *****/
#endif
NSLog輸出宏
#ifdef DEBUG
#define HYLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#define HYLog(...)
#endif
獲取版本宏
/*** 當前系統版本判斷 ***/
#define iOS(version) ([UIDevice currentDevice].systemVersion.doubleValue >= (version))
將responsObject打印成plist到桌面
/*** 將服務器返回的數據寫入plist ***/
#define ZJWriteToPlist(data, filename) [data writeToFile:[NSString stringWithFormat:@"/Users/zhang/Desktop/%@.plist", filename] atomically:YES];
顏色宏
/*** 顏色 ***/
#define ZJColorA(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)/255.0]
#define ZJRandomColor XMGColor(arc4random_uniform(255), arc4random_uniform(255), arc4random_uniform(255))