3 ms·
You may find the following useful: #define A(obj, objs...) [NSArray arrayWithObjects:obj, ## objs , nil] #define D(val, key, vals...) [NSDictionary dic
by jsolson 16y ago
You may find the following useful:
#define A(obj, objs...) [NSArray arrayWithObjects:obj, ## objs , nil]
#define D(val, key, vals...) [NSDictionary dictionaryWithObjectsAndKeys:val, key, ## vals , nil]
I put these two macros in the prefix header for every Objective-C project I do. Say what you will about single character macros, these save me time and improve readability (for me, anyway... I'm not sure how others reading my code down the road fare, but so far there haven't been many of those).
- elai 16y agoOne of those obvious things that you feel stupid for not realizing. Thanks!