Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ignoring performSelector-leak warnings only as needed

instead of disabling the performSelector-leak warning for the whole category, pushing this onto the clang diagnostic stack as needed
  • Loading branch information...
commit fa4a2877b67be317858ec127e2ad92a39f3d3a13 1 parent 16bc8e8
@duanefields duanefields authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 Source/Categories/NSManagedObject+MagicalDataImport.m
View
10 Source/Categories/NSManagedObject+MagicalDataImport.m
@@ -8,7 +8,6 @@
#import "CoreData+MagicalRecord.h"
#import <objc/runtime.h>
-#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
void swizzle(Class c, SEL orig, SEL new);
@@ -68,7 +67,10 @@ - (BOOL) MR_importValue:(id)value forKey:(NSString *)key
SEL selector = NSSelectorFromString(selectorString);
if ([self respondsToSelector:selector])
{
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
[self performSelector:selector withObject:value];
+#pragma clang diagnostic pop
return YES;
}
return NO;
@@ -125,7 +127,10 @@ - (void) MR_addObject:(NSManagedObject *)relatedObject forRelationship:(NSRelati
{
//Need to get the ordered set
NSString *selectorName = [[relationshipInfo name] stringByAppendingString:@"Set"];
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
relationshipSource = [self performSelector:NSSelectorFromString(selectorName)];
+#pragma clang diagnostic pop
addRelationMessageFormat = @"addObject:";
}
}
@@ -169,6 +174,8 @@ - (void) MR_setRelationships:(NSDictionary *)relationships forKeysWithDictionary
SEL shouldImportSelector = @selector(shouldImport:);
BOOL implementsShouldImport = [self respondsToSelector:shouldImportSelector];
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
if (![self MR_importValue:relatedObjectData forKey:relationshipName])
{
if ([relationshipInfo isToMany])
@@ -190,6 +197,7 @@ - (void) MR_setRelationships:(NSDictionary *)relationships forKeysWithDictionary
}
}
}
+#pragma clang diagnostic pop
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.