Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift keeps throwing errors, can't find out why

My swift app keeps throwing some fatal errors:

fatal error: unexpectedly found nil while unwrapping an Optional value

The only problem is I can't seem to find out what line of code causes this error. Is there a way to see the line of code that is causing this error?

The project is too big to upload here so this is like the only thing I can do.

Best regards, Luca Panjer

like image 901
Luca Panjer Avatar asked Oct 30 '22 12:10

Luca Panjer


1 Answers

Xcode should halt the application and display the offending line in the editor with an EXC_BAD_ACCESS error. The comment about restarting Xcode is probably the best first troubleshooting step, as this behavior should occur whether or not you set an exception breakpoint (because this is a fatal, crashing error, not an exception). You may also try restarting your Mac entirely. I've had situations where Xcode just didn't behave properly until I completely restarted my Mac.

like image 153
Joshua Nozzi Avatar answered Nov 09 '22 18:11

Joshua Nozzi