Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image 允许用户在Cocoa应用程序中提交图像_Image_Core Data_Interface Builder - Fatal编程技术网

Image 允许用户在Cocoa应用程序中提交图像

Image 允许用户在Cocoa应用程序中提交图像,image,core-data,interface-builder,Image,Core Data,Interface Builder,如何在interface builder中设置一个对象,允许用户提交图像(如在通讯簿中编辑vCard时),并将其保存到由Core Data管理的数据库中的相应条目中 解决方案 使用NSImageView对象。在对象检查器的第一个面板上,您将看到一个标记为Editable的复选框,该复选框将允许您决定是接受提交还是仅显示输出 对象的绑定如下所示: -> Value.Data Bind to: Source Entity Controller Key: selection

如何在interface builder中设置一个对象,允许用户提交图像(如在通讯簿中编辑vCard时),并将其保存到由Core Data管理的数据库中的相应条目中

解决方案

使用
NSImageView
对象。在对象检查器的第一个面板上,您将看到一个标记为
Editable
的复选框,该复选框将允许您决定是接受提交还是仅显示输出

对象的绑定如下所示:

-> Value.Data
    Bind to: Source Entity
    Controller Key: selection
    Model Key Path: Name of the attribute within the entity storing the image data

我认为
NSImageView
会起作用。链接到引用:


如果我记得清楚的话,这个组件可以在Interface Builder上使用。

Ah,以前没有在inspector上看到可编辑的
复选框。谢谢为便于将来参考,如果其他任何人有相同的问题,绑定到
NSImageView
对象的操作如下:->值。数据绑定到:源实体控制器键:选择模型键路径:存储图像数据的属性的名称,忘记了无法格式化回复。将添加到原来的帖子中。再次感谢!