Created
April 17, 2011 16:42
-
-
Save stevestreza/924200 to your computer and use it in GitHub Desktop.
Some convenience macros for common types of objects in ObjC
This file contains 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
#define MWDict(...) ((NSDictionary *)[NSDictionary dictionaryWithObjectsAndKeys:__VA_ARGS__, nil]) | |
#define MWArray(...) ((NSArray *)[NSArray arrayWithObjects:__VA_ARGS__, nil]) | |
#define MWSet(...) ((NSSet *)[NSSet setWithObjects:__VA_ARGS__, nil]) | |
#define MWURL(str, ...) ((NSURL *)[NSURL URLWithString:[NSString stringWithFormat:(str), ##__VA_ARGS__]]) | |
#define MWString(str, ...) ((NSString *)[NSString stringWithFormat:(str), ##__VA_ARGS__]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment