Skip to content

Compiler warnings in NSManagedObject+MagicalDataImport.m (new) #103

XMLSDK opened this Issue Dec 10, 2011 · 10 comments

4 participants

XMLSDK commented Dec 10, 2011

From NSManagedObject+MagicalDataImport.m it complains about "NSString may not respond to MR_capitalizedFirstCharaterString". It may because there does not exist ```
@interface NSString (MagicalRecord_DataImport)

  • (NSString *) MR_capitalizedFirstCharaterString; @end```

Also, Xcode also warns about
if (implementsShouldImport && !(BOOL)[self performSelector:shouldImportSelector withObject:singleRelatedObjectData]) and
if (!(implementsShouldImport && !(BOOL)[self performSelector:shouldImportSelector withObject:relatedObjectData])) that
Cast from pointer to integer of different size. Shouldn't the right way to test id is == nil ?

XMLSDK commented Dec 10, 2011

I am at tag 1.8.2.

That @implementation NSString (MagicalRecord_DataImport) exists in NSManagedObject+MagicalDataImport.m but there is no @interface NSString (MagicalRecord_DataImport). The compiler cannot find this interface declaration.

Return type of performSelector is id. And it's the cast to BOOL gives warning.

I targeted iPad 5.0 Simulator, Xcode 4.2.1 Build 4D502, No ARC, LLVM GCC 4.2


So, after "fixing" the compiler warnings, this unit tests for 4.3 subsequently break :(
This is going to take a little more time to finesse...
But on that note, the next release will also be the last one that fully supports iOS4.3 and LLVM GCC.
I use MagicalRecord only on iOS5 and the Apple LLVM 3.0 compiler at this time.

XMLSDK commented Dec 10, 2011

I wonder if this works: if (implementsShouldImport && nil==[self performSelector:shouldImportSelector withObject:singleRelatedObjectData]), simply test performSelector returns nil.

Sorry to hear about that. Many customers have not upgraded their devices to iOS5 yet. (though this warning issue is minor one)

Thank you for noting this anyway.


Ok, I've gone through the project, and I'm no longer seeing these warnings. Can you please verify that this resolves this issue? I've included the changes in tag 1.8.3


I am new to this forum but I am see the following warnings. I think I am on the latest code drop.

SEL selector = NSSelectorFromString(selectorString);
if ([self respondsToSelector:selector])
[self performSelector:selector withObject:value];
return YES;
return NO;

relationshipSource = [self performSelector:NSSelectorFromString(selectorName)];

if (implementsShouldImport && !(BOOL)[self performSelector:shouldImportSelector withObject:singleRelatedObjectData])

if (!(implementsShouldImport && !(BOOL)[self performSelector:shouldImportSelector withObject:relatedObjectData]))


OK. Will wait. Thanks

@blackgold9 blackgold9 closed this Sep 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.