From 2db62fd4fd3e2853523ef6919c6a8eba8c61e3d4 Mon Sep 17 00:00:00 2001 From: Jelle Vandebeeck Date: Mon, 26 Dec 2011 19:37:51 +0100 Subject: [PATCH 1/2] ARC Integration --- NSDictionary+Coby.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NSDictionary+Coby.m b/NSDictionary+Coby.m index fbf1e77..6c40a13 100644 --- a/NSDictionary+Coby.m +++ b/NSDictionary+Coby.m @@ -22,7 +22,11 @@ - (NSDictionary *)merge:(NSDictionary *)otherDictionary { [otherDictionary each: ^(id key, id obj) { [result setObject:obj forKey:key]; }]; +#if __has_feature(objc_arc) + return (NSDictionary *) [result mutableCopy]; +#else return (NSDictionary *) [[result mutableCopy] autorelease]; +#endif } // The value for each duplicate key is determined by calling the @@ -52,7 +56,11 @@ - (NSDictionary *)merge:(NSDictionary *)otherDictionary withBlock:(id (^)(NSStri [result setObject:obj forKey:key]; } }]; +#if __has_feature(objc_arc) + return (NSDictionary *) [result mutableCopy]; +#else return (NSDictionary *) [[result mutableCopy] autorelease]; +#endif } // # Fetch From dc33fd4b15d626840d67218becbc0936b094a159 Mon Sep 17 00:00:00 2001 From: Jelle Vandebeeck Date: Mon, 26 Dec 2011 19:38:20 +0100 Subject: [PATCH 2/2] Fixed performSelector warning for ARC --- NSObject+Coby.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NSObject+Coby.m b/NSObject+Coby.m index ed3737a..5614245 100644 --- a/NSObject+Coby.m +++ b/NSObject+Coby.m @@ -1,6 +1,6 @@ #import #import "NSObject+Coby.h" - +#import @implementation NSObject (Coby) @@ -11,7 +11,7 @@ - (id)send:(NSString *)method { // Basically an alias for `performSelector:withObject:` - (id)send:(NSString *)method with:(id)object { - return [self performSelector:NSSelectorFromString(method) withObject:object]; + return objc_msgSend(self, NSSelectorFromString(method)); } // # Try