Swift 大家好!有人能帮我解释一下这个错误消息的意思吗?

Swift 大家好!有人能帮我解释一下这个错误消息的意思吗?,swift,uiimagepickercontroller,Swift,Uiimagepickercontroller,你们中的一些人知道是什么原因导致了这个问题吗?我在iPhone 11 Max Pro上运行此应用程序,但缺少文本标签,相机工作正常,并将该图片添加到“收藏视图”单元,在添加“隐私摄像头使用说明”后,我注意到另一件事在Info.plist中,该警报只会在启动应用程序后出现一次,与启动应用程序的次数一样,它只会在未经您许可的情况下打开相机。我在调试控制台中也收到了这个错误消息,我不太明白,但一切正常。这就是我得到的错误: 2021-05-22 01:31:49.641241+0100 Project

你们中的一些人知道是什么原因导致了这个问题吗?我在iPhone 11 Max Pro上运行此应用程序,但缺少文本标签,相机工作正常,并将该图片添加到“收藏视图”单元,在添加“隐私摄像头使用说明”后,我注意到另一件事在Info.plist中,该警报只会在启动应用程序后出现一次,与启动应用程序的次数一样,它只会在未经您许可的情况下打开相机。我在调试控制台中也收到了这个错误消息,我不太明白,但一切正常。这就是我得到的错误:

2021-05-22 01:31:49.641241+0100 Project10 - Names & Faces App[87131:7546271] [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}





 @objc func addNewPerson() {
        let picker =  UIImagePickerController()
        picker.sourceType = .camera
        picker.allowsEditing = true
        picker.delegate = self
        present(picker, animated: true)
        debugPrint(picker)
    }
    
    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { // user has selected an image data from their camera which has acces to their photo library
        
        
        
        guard let image = info[.editedImage] as? UIImage else { return } // imaged is pulled out from image picker and is type casted/ if there's no image then  -> return
        
        let imageName = UUID().uuidString // new filename is created for the image what just got imported
        let imagePath = getDocumentsDirectory().appendingPathComponent(imageName) // path is created for the file [random file name, which basically is the copy of the original image which is imported] which is the new UUID filename
        
        if let jpegData = image.jpegData(compressionQuality: 0.8)  { // image is converted to a JPEG data format with a quality value of 80%
            try? jpegData.write(to: imagePath) // write JPEG data to the file name [created by UUID] which s saved to the current document directory
        }
        
        let person = Person(name: "Unknown", image: imageName)
        people.append(person)
        collectionView.reloadData()
        
        dismiss(animated: true) // view controller get dismissed
    }

请参阅Jon Skeet的帮助页面和博客文章。两件事。UIImagePickerController可能需要比您列出的更多的
info.plist
隐私密钥。第二,你为什么认为这是个问题?也许你可以为我发布更多,以复制你的问题?好吧,我想。。。。为什么-如果相机正常工作-你认为相机是问题所在吗?既然(从你含糊不清的问题)听起来你在使用相机后遇到了问题(可能是立即发生的),为什么不发布代码呢。显然,
数据为空
。也许这与您的代表处理事情的方式有关?@dfd我在info.plist中为摄像头授权添加了一行,警告只显示一次,不是每次我请求使用摄像头时都会显示一次,一旦我点击左侧的“添加”按钮,错误就会弹出,我肯定会分享一些代码,谢谢您的回复!我的ViewController符合:UICollectionViewController、UIImagePickerControllerDelegate和UINavigationControllerDelegate{右now@dfd我将分享上面的一些代码。@dfd我在picket方法中放置了一个debugPrint,当我点击它时,基本上我捕获了那个错误,但一切似乎都很正常。