UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Project 10 challenge 2. Need a bit of help! Capturing error message [Camera] fail to read exposureBiasesByMode dictionary: Error

Forums > 100 Days of Swift

Hi guys I'm kind of confused regading that return value for "UIImagePickerController.isSourceTypeAvailable()" were do we need to declare this method? my camarea works perfectly fine but I'm capturing an error message in my debug console which is this:

Did someone solve this issue if yes can you guys help me out a bit? Thanks This error is captured after I tap the "Add" button.

<UIImagePickerController: 0x14a011800> 2021-05-22 21:49:13.686567+0100 Project10 - Names & Faces App[90897:7865790] [Camera] Failed to read exposureBiasesByMode dictionary: Error Domain=NSCocoaErrorDomain Code=4864 " -[NSKeyedUnarchiver _initForReadingFromData:error:throwLegacyExceptions:]: data is NULL" UserInfo={NSDebugDescription= -[NSKeyedUnarchiver _initForReadingFromData:error:throwLegacyExceptions:]: data is NULL}

4      

I tried this:

    @objc func addNewPerson() {
        let picker = UIImagePickerController()
        picker.allowsEditing = true
        if UIImagePickerController.isSourceTypeAvailable(.camera) {
            picker.sourceType = .camera
        }
        picker.delegate = self
        present(picker, animated: true)
    }

Paul said this'll only be true on device. In the simulator, it'll return false and show the photo library picker.

But on my iPhone this locks up the app.

3      

Hacking with Swift is sponsored by RevenueCat

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.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.