objective-c - 分配给 'void (^)(__strong id 的块指针类型不兼容)' 来自 'void (^)(TGClipboardGalleryPhotoItem *__strong)'
问题描述
我是ios开发新手。我的代码是
[model.interfaceView updateSelectionInterface:selectionContext.count counterVisible:(selectionContext.count > 0) animated:false];
model.interfaceView.donePressed = ^(TGClipboardGalleryPhotoItem *item)
{
__strong TGClipboardGalleryMixin *strongSelf = weakSelf;
if (strongSelf == nil)
return;
strongSelf->_galleryModel.dismiss(true, false);
if (strongSelf.completeWithItem != nil)
strongSelf.completeWithItem(item);
};
*行错误:model.interfaceView.donePressed = ^(TGClipboardGalleryPhotoItem item)
我收到以下错误:
*从 'void (^)(TGClipboardGalleryPhotoItem __strong)'分配给 'void (^)(__strong id)' 的不兼容块指针类型
我曾尝试将 typedef 添加到代码中,但它并没有解决我的问题。
解决方案
推荐阅读
- three.js - Three.js 将加载的 glb 模型的网格几何图形转换为与边界框具有相同的中心
- c# - 是否可以连接到在程序外部创建的内存中 Sqlite 数据库?
- php - 如何使用 Laravel 生成报告票号?
- apache-kafka - 处理 kafka 消费者中的反序列化错误(死信队列)
- entity-framework - 添加数据时是否可以确保顺序?
- excel - 如何仅禁用 Excel 电子表格中特定列的填充句柄?
- python - 计算嵌套列表中的最大差异
- html - 如何在使用 Spacy NER 预测命名实体时从文本中删除 html 标签,并再次使用 html 标签以原始格式显示相同的文本?
- d3.js - d3 浮动分组条在时间轴中具有范围值
- c# - 如何强制 MVC 应用程序在启用 Windows 身份验证的情况下要求提供凭据