Jiri Bruchanov
02/21/2024, 5:36 PMNSInvalidArgumentException
, but having a test with the call in try/catch statement doesn't catch it 🤔Jiri Bruchanov
02/21/2024, 5:36 PMval controller = UIImagePickerController()
runCatching {
controller.setSourceType(UIImagePickerControllerSourceType.UIImagePickerControllerSourceTypeCamera)
}
basically having this code, and the test still failing due to
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Source type 1 not available'
*** First throw call stack:
(
0 CoreFoundation 0x000000018048d8a8 __exceptionPreprocess + 172
1 libobjc.A.dylib 0x000000018008409c objc_exception_throw + 56
2 UIKitCore 0x0000000184adebcc -[UIImagePickerController sourceType] + 0
....
Pamela Hill
02/25/2024, 1:26 PMJiri Bruchanov
02/25/2024, 1:29 PMextraOpts = listOf("-Xforeign-exception-mode", "objc-wrap")
but I'm not sure how to apply it for "project" in general...
the exception is not from 3rd party (cocoalib) dependencyPamela Hill
02/25/2024, 9:29 PM