Macros úteis para projeto iOS

//Debug
#define debug(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])

// 2.1 Easy RGB for convenience
#define RGB(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1]

// 2.2 Gets the path of a file inside the documents dir
#define FileFromDocPath(filepath) [NSHomeDirectory() stringByAppendingPathComponent:(filepath)]

// 2.3 Removes a file from the documents dir
#define RemoveFileFromDocPath(path) [[NSFileManager defaultManager] removeItemAtPath:[NSHomeDirectory() stringByAppendingPathComponent:(path)] error:nil]

// 2.4 Fast userdefaults getter
#define Setting(param) [[NSUserDefaults standardUserDefaults] objectForKey:(param)]
#define BoolSetting(param) [[NSUserDefaults standardUserDefaults] boolForKey:(param)]
#define IntSetting(param) [[NSUserDefaults standardUserDefaults] integerForKey:(param)]

// 2.5 String Macros
#define DBNULL @"[NULL]"
#define NOT_AVAILABLE @""