Closed tylerjames closed 2 years ago
Wow, this is a tough one! Would you create a minimal project that reproduces this problem so I can check it? (See https://ootips.org/yonat/repex/)
If I can get to around it.
It comes from the SweeterSwift library. But Multislider only uses extensions from UIView+Sweeter. It's the NSManagedContext one that seems to be causing a problem.
It's very strange because I've had this library in use for months and I'm sure it's run on iOS 14 before. I recently got an M1 Pro so I don't know if it's just building it differently. There's no compiler error associated with it. It's just a runtime crash due to the code merely existing (it's never called by Multislider)
I made a fork that just removes the SweeterSwift dependency and copies over the UIView+SweeterSwift extension and that was enough to get it working.
Okay I found the issue. In your NSManagedObjectContext.printAllObjects()
function on this line:
guard let objects = try? fetch(NSFetchRequest(entityName: entityName)) else { continue }
Change it to this:
guard let objects = try? fetch(NSFetchRequest<NSFetchRequestResult>(entityName: entityName)) else { continue }
I don't know why it causes a crash on iOS 14 just by existing in the first form but adding the generic fixes it.
Thanks! I wasn't able to reproduce the crash, but the change you suggest doesn't cause any problems so I add it to SweeterSwift 1.2.1 .
Strangely getting a crash now when run on iOS 14.6+ but not iOS 15. App crashes right at startup with this message. Strangely had this in the app for a while and it only started causing a problem recently. Built on an M1 Pro. Not sure if that makes a difference