Permalink
Browse files

Added ASSIGNCOPY and ASSIGNMUTABLECOPY.

  • Loading branch information...
1 parent c5c3c43 commit 31ccfaf16a4d931151bb759d510aa69d816d7150 @uliwitness committed Apr 11, 2010
Showing with 12 additions and 0 deletions.
  1. +12 −0 UKHelperMacros.h
View
@@ -64,6 +64,18 @@
(targ) = [(newval) retain];\
[__UKHELPERMACRO_OLDTARG release];\
} while(0)
+
+#define ASSIGNCOPY(targ,newval) do {\
+ NSObject* __UKHELPERMACRO_OLDTARG = (NSObject*)(targ);\
+ (targ) = [(newval) copy];\
+ [__UKHELPERMACRO_OLDTARG release];\
+ } while(0)
+
+#define ASSIGNMUTABLECOPY(targ,newval) do {\
+ NSObject* __UKHELPERMACRO_OLDTARG = (NSObject*)(targ);\
+ (targ) = [(newval) mutableCopy];\
+ [__UKHELPERMACRO_OLDTARG release];\
+ } while(0)
#define DESTROY(targ) do {\
NSObject* __UKHELPERMACRO_OLDTARG = (NSObject*)(targ);\

0 comments on commit 31ccfaf

Please sign in to comment.