当我全新安装应用程序并尝试添加照片时,即使在授予权限后,图像选择器(我正在使用 QBImagePickerController)也无法加载任何相册或图像。但是如果我终止应用程序并重新启动它就可以了。它发生在 iOS 15.2 更新之后。这是在模拟器中运行时的日志。
Failed to load library: Error Domain=com.apple.photos.error Code=41011 "Unauthorized access: client does not have valid TCC authorization" UserInfo={NSLocalizedDescription=Unauthorized access: client does not have valid TCC authorization}
failed to load photo library PHPhotoLibraryMainQueueQoS with url file:///...., Error Domain=com.apple.photos.error Code=41011 "Unauthorized access: client does not have valid TCC authorization" UserInfo={NSLocalizedDescription=Unauthorized access: client does not have valid TCC authorization}
[GatekeeperXPC] Failed to open photo library file://..../data/Media/, Error Domain=com.apple.photos.error Code=41011 "Unauthorized access: client does not have valid TCC authorization" UserInfo={NSLocalizedDescription=Unauthorized access: client does not have valid TCC authorization}