DocumentScanner
DocumentScanner copied to clipboard
Terminating app due to uncaught exception
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle app.app> (loaded)' with name 'ScannerView'' terminating with uncaught exception of type NSException
Will add that I am using SPM
@willm132 hello, yes this is a very common problem, with NSBundle especially if you use SPM. What happen is that NSBundle is looking for the nib in the App Bundle, but probably the NIB is in your SPM bundle., correct?
An easy way to fix this will be to update the code with: https://developer.apple.com/documentation/foundation/nsbundle/1417717-bundleforclass Where you will use a class present in your SPM. This way, when you initiate NSBundle it will search for it in the Package bundle rather than the main app bundle.
Please let me know if it works
I ended up just removing SPM and using Cocoapods instead and it's working now. Thanks!