magicalpanda / MagicalRecord

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

Crash while using MR_findAllSortedBy:ascending:withPredicate:inContext #1307

Open adibuildup opened 7 years ago

adibuildup commented 7 years ago

Hi,

We integrated Magical Record to our app a few month ago, and we encountered a few issues:

  1. when we open the app we want to update the core data in the background, but let the user use the app and not disable the UI completely, The problem is the ui get stuck when we do saveWithBlock, I read that if you don't use with completion it should be faster, but then duplicate entities appear. so we use saveWithBlock with completion, but the UI get stuck, especially if the battery is low.

  2. we get a lot of crashes from magical record, that we can't reproduce or understand why they only happen sometimes to some of our users, most of the crashes came from this code:

__67+[NSManagedObject(MagicalRecord) MR_executeFetchRequest:inContext:]_block_invoke (in Buildup) (NSManagedObject+MagicalRecord.m:54)

after we are trying to use sort method:

+[NSManagedObject(MagicalFinders) MR_findAllSortedBy:ascending:withPredicate:inContext:] (in Buildup) (NSManagedObject+MagicalFinders.m:56)

do you have any idea what can cause it? we added try and catch but the app still crashes, and I can't understand why it works most of the times but happen every now and then.

*those crashes/problem happen with the newest XCode version and iOS 10.1.1 and above ** we use version 2.3.2 of Magical record (I think that's the newest)

let me know if you need any more information ...Thanks!