jjzjj

iphone - 不会是 SourceTypeAvailable :UIImagePickerControllerSourceTypeSavedPhotosAlbum always return YES?

coder 2024-01-26 原文

有时我对 iOS 开发感到困惑。这不会总是返回 true 吗?

if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum])
{
    //
}

最佳答案

如果用户的照片库中没有图像,则返回 NO。来自 UIImagePickerController isSourceTypeAvailable: 的文档:

Because a media source may not be present or may be unavailable, devices may not always support all source types. For example, if you attempt to pick an image from the user’s library and the library is empty, this method returns NO.

关于iphone - 不会是 SourceTypeAvailable :UIImagePickerControllerSourceTypeSavedPhotosAlbum always return YES?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13104823/

有关iphone - 不会是 SourceTypeAvailable :UIImagePickerControllerSourceTypeSavedPhotosAlbum always return YES?的更多相关文章

随机推荐