magicalpanda / MagicalRecord

Super Awesome Easy Fetching for Core Data!
Other
10.8k stars 1.79k forks source link

Shorthand methods - possible typo? #1175

Closed ashaman closed 5 years ago

ashaman commented 8 years ago

Hi there, I'm using MagicalRecord v.2.3.2 from master (with CocoaLumberjack support) and I'm experiencing some issues with shorthand instance methods, like -inContext (I receive unrecognized selector exceptions). At the same moment, shorthand class methods are resolved correctly.

After the debugging, it seems to me that there's a typo in MagicalRecord+ShorthandMethods.m, line 93. Adding "!", like in the example below, resolved all shorthand issues for me:

!([originalSelectorString hasPrefix:@"_"] || [originalSelectorString hasPrefix:@"init"]))

I've searched for similar issues, but found nothing like this.

tonyarnold commented 8 years ago

I can't remember why these checks are even in here. @casademora do you have any recollection about why we would explicitly include or exclude class methods starting with _ or init? In theory, this method should only target methods starting with MR_.

Coeur commented 5 years ago

Fixed in a4c59b55c9be1093812818330705806e96d7a654 (2.3.3 for Carthage, 2.4.0 for CocoaPods)