Skip to content

Instantly share code, notes, and snippets.

@sarnesjo
Created April 6, 2010 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sarnesjo/357492 to your computer and use it in GitHub Desktop.
Save sarnesjo/357492 to your computer and use it in GitHub Desktop.
convenience macros for creating NSArray and NSDictionary instances
#define A(...) [NSArray arrayWithObjects:__VA_ARGS__, nil]
#define D(...) [NSDictionary dictionaryWithObjectsAndKeys:__VA_ARGS__, nil]
NSArray *a = A(@"foo", @"bar");
NSDictionary *d = D(@"1", @"foo", @"2", @"bar");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment