Skip to content
This repository

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

Closed
XMLSDK opened this Issue · 10 comments

4 participants

Simon Chow Magical Panda Software Sunny Lim Stephen Vanterpool
Simon Chow

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 ?

Magical Panda Software
Simon Chow

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

Magical Panda Software
Magical Panda Software

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.

Simon Chow

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.

Magical Panda Software
Magical Panda Software

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

Sunny Lim

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]))

Magical Panda Software
Sunny Lim

OK. Will wait. Thanks

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.