Created
November 19, 2012 20:17
-
-
Save wess/4113614 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __WC__MACROS__ | |
#define __WC__MACROS__ | |
#define AND && | |
#define OR || | |
#define APP_VERSION [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] | |
#define APP_EXECUTABLE [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleExecutable"] | |
#define APP_NAME [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"] | |
#define RED [NSColor redColor] | |
#define WHITE [NSColor whiteColor] | |
#define BLACK [NSColor blackColor] | |
#define BLUE [NSColor blueColor] | |
#define GREEN [NSColor greenColor] | |
#define YELLOW [NSColor yellowColor] | |
#define MAGENTA [NSColor magentaColor] | |
#define GRAY [NSColor grayColor] | |
#define LIGHTGRAY [NSColor lightGrayColor] | |
#define CLEAR [NSColor clearColor] | |
#define HEX_COLOR(hex) [NSColor fromHexString:hex] | |
#define PATH_FOR_RESOURCE(filename, type) [[NSBundle mainBundle] pathForResource:filename ofType:type] | |
#define READ_FILE(filename, type) [[NSString alloc] initWithContentsOfFile:PATH_FOR_RESOURCE(filename, type) encoding:NSUTF8StringEncoding error:nil] | |
#define GLOBAL_QUEUE dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) | |
#define MAIN_QUEUE dispatch_get_main_queue() | |
// User Defaults | |
#define GET_USER_DEFAULT(key) [[NSUserDefaults standardUserDefaults] valueForKey:key] | |
#define GET_USER_DEFAULT_INT(key) [[NSUserDefaults standardUserDefaults] integerForKey:key] | |
#define GET_USER_OBJECT(key) [[NSUserDefaults standardUserDefaults] objectForKey:key] | |
#define SET_USER_DEFAULT(key, val) [[NSUserDefaults standardUserDefaults] setValue:val forKey:key] | |
#define SET_USER_DEFAULT_OBJECT(key, obj) [[NSUserDefaults standardUserDefaults] setObject:obj forKey:key] | |
#define SET_USER_DEFAULT_INT(key, intgr) [[NSUserDefaults standardUserDefaults] setInteger:intgr forKey:key] | |
#define DELETE_USER_DEFAULT(key) [[NSUserDefaults standardUserDefaults] removeObjectForKey:key] | |
#define SYNC_USER_DEFAULTS [[NSUserDefaults standardUserDefaults] synchronize] | |
#endif | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment