magicalpanda / MagicalRecord

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

MR3 crash when doing MR_findAllSortedBy with multiple attributes in swift 2 #1136

Closed PatrickSCLin closed 8 years ago

PatrickSCLin commented 8 years ago

it was working fine in swift 1.2, but occurred error after I update to Xcode7

ex: Camera.MR_findAllSortedBy("create_time,sub_cameras", ascending: true, withPredicate: predicate, inContext: self.privateContext)

2015-11-18 11:30:59.741 -[_NSFaultingMutableSet compare:]: unrecognized selector sent to instance 0x138544f00 2015-11-18 11:30:59.742 *\ Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_NSFaultingMutableSet compare:]: unrecognized selector sent to instance 0x138544f00'

PatrickSCLin commented 8 years ago

just sorted by one attribute, it works fine.

PatrickSCLin commented 8 years ago

I think I found some clues, the second attribute "sub_cameras" is an optional property, it might be null in some cases, was it cause my app crash ?

but it was working fine in XCode6.