Invalid parameter not satisfying: “assetUUID“

2023-10-11 20:13

本文主要是介绍Invalid parameter not satisfying: “assetUUID“,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

问题:加载相册->退出相册->加载相册,第二次加载相册的时候,调用下面这个方法,用不到asset.localIdentifier, 但是报标题的错

- (PHImageRequestID)requestImageForAsset:(PHAsset *)asset targetSize:(CGSize)targetSize contentMode:(PHImageContentMode)contentMode options:(PHImageRequestOptions *)options resultHandler:(void (^)(UIImage *result, NSDictionary *info))resultHandler;

原因:传的asset是空,所以得不到asset.localIdentifier。代码中先调用了我的collectionView:cellForItemAtIndexPath:加载cell,但是我用的数据中asset还没有执行到更新的地方,所以加载的cell传参数asset是空

解决方法:album asset数组已经非空的条件下,collectionView:cellForItemAtIndexPath:直接获取asset数据,而不是通过self.xx去获取,避免"得到非空数组 -> 访问还没有更新的self.xx -> cell传参数asset是空"

- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {TempCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kTempCellIdetifier forIndexPath:indexPath];NSArray<PHAsset *> *assetArray = [TempData.sharedInstance fetchPHAsset];[cell updateForImage: assetArray[indexPath.item]];return cell;
}

不重要的:怎么让album asset数组非空?用PHPhotoLibraryChangeObserver这个协议,当授予权限后并且registerChangeObserver: ,用户授权后相册调用PHPhotoLibraryChangeObserver协议的方法,通过delegate让需要更新相册的对象reload collectionView

如果不是我这种情况,据说有的情况asset非空,localIdentifier是空,需要再看看。

这篇关于Invalid parameter not satisfying: “assetUUID“的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/190546

相关文章

瑞芯微Parameter File Format解析

Rockchip android系统平台使用parameter文件来配置一些系统参数 主要包含:串口号:nandflash分区 固件版本,按键信息等; 如下是台电P98HD的parameter参数: FIRMWARE_VER:4.1.1        // 固件版本 //固件版本,打包 updata.img 时会使用到,升级工具会根据这个识别固件版本。 //Boot loader 会读取

iOS项目发布提交出现invalid code signing entitlements错误。

1、进入开发者账号,选择App IDs,找到自己项目对应的AppId,点击进去编辑, 2、看下错误提示出现  --Specifically, value "CVYZ6723728.*" for key "com.apple.developer.ubiquity-container-identifiers" in XX is not supported.-- 这样的错误提示 将ubiquity

python eval报错 SyntaxError: invalid token

a = eval(startTime)   File "<string>", line 1     2019-01-02 11:00:00               ^ SyntaxError: invalid token startTime = '2019-01-02 11:00:00'a = eval(startTime) 具体内容如上: 后来发现,在eval中的

解决树莓派IOError: [Errno Invalid sample rate] -9997 采样率16K错误

树莓派在基于pyaudio录音的时候会提示如上错误,这主要是使用的树莓派声卡不支持当前的采用率,没关系,其实在alsa架构下我们可以通过声卡的插件实现转换。在树莓派下家目录创建一个声卡隐藏配置文件 .asoundrc。特别说明,不要在你的pyaudio里面设置打开声卡的编号因为下面的配置已经配置了。 1.安装 sudo apt-get install pulseaudio 2.在家目录创

CUICatalog: Invalid asset name supplied: (null), or invalid scale factor: 2.000000错误解决方案

[[UIImage imageNamed:@""] 当后面的字符串为空时,会出现题目中的错误 if (imagstr != nil) {         cell.imageView.image =[UIImage imageNamed:imagstr];     }

​yum安装/更新时报错:SyntaxError: invalid syntax​

yum安装时报错:SyntaxError: invalid syntax 在安装完python3环境后,执行yum命令会提示语法报错 因为把python环境连接到了python3上,而yum默认的环境是python2,所以提示语法错误 解决方法: 1:你可以把python2的语法格式修改为python3,这工作量就有点大了。不过要是哪位很无聊的话可以试试,记得把成果分享出来啊O(∩_∩)O

《The Power of Scale for Parameter-Efficient Prompt Tuning》论文学习

系列文章目录 文章目录 系列文章目录一、这篇文章主要讲了什么?二、摘要中T5是什么1、2、3、 三、1、2、3、 四、1、2、3、 五、1、2、3、 六、1、2、3、 七、1、2、3、 八、1、2、3、 一、这篇文章主要讲了什么? The article “The Power of Scale for Parameter-Efficient Prompt Tuning

datetime.datetime.fromtimestamp(0) OSError: [Errno 22] Invalid argument

将datetime.datetime.fromtimestamp(0)修改为datetime.datetime.fromtimestamp(86400)               https://blog.csdn.net/qq_30339595/article/details/88778967

The remote endpoint was in state [TEXT_FULL_WRITING] which is an invalid state for called method 已解决

前面有个webSocket自动断开连接的问题,已解决,请见博客: webSocket java.io.EOFException: null 增加心跳机制解决 然后又报了一个错: java.lang.IllegalStateException: The remote endpoint was in state [TEXT_FULL_WRITING] which is an invalid st

/usr/bin/ccache: invalid option -- 'E'

编译包含CUDA的OpenCV 时遇到问题 [ 1%] Built target proto[ 1%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile.dir/layers/cuda_compile_generated_split_layer.cu.o/usr/bin/ccache: invalid opti