Skip to content

Instantly share code, notes, and snippets.

@Machx
Created August 12, 2009 01:45
Show Gist options
  • Save Machx/166253 to your computer and use it in GitHub Desktop.
Save Machx/166253 to your computer and use it in GitHub Desktop.
#define NSDICT(...) [NSDictionary dictionaryWithObjectsAndKeys: __VA_ARGS__, nil]
#define NSARRAY(...) [NSArray arrayWithObjects: __VA_ARGS__, nil]
#define NSBOOL(_X_) [NSNumber numberWithBool:(_X_)]
//example usage
NSArray *items = NSARRAY(NSDICT(@"Hello World!", @"title",
[NSImage imageNamed:@"worldHello"], @"icon",
NSBOOL(YES), @"isAwesome"),
NSDICT(@"Good Bye, World!", @"title",
[NSImage imageNamed:@"winkyfrownyface"], @"icon",
NSBOOL(NO), @"isAwesome"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment