When opening a particular view, my app sometimes crashes, causing the following to appear in the debug area:
The view that is causing the crash when opened:
The weird thing is that it doesn't always crash when I open that view. I think it might have something to do with CoreData, because I use it with coordinates that are saved in there. Though the view I fetch the data in seems to work fine.
Does anyone have a clue on what causes this error? Thank you in advance!
Note: After trying a few things, I just found out that removing the renderGraphImg() function stops the app from crashing. Still I'd really want to know what exactly caused the trouble, because removing the renderGraphImg() function means removing an important functionality of my app.
Found out that making the graphToShare variable optional and setting it's start value to nil (and unwrapping it in the view's body) solved the problem. But I don't know why this solution works...
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.