Core Data如何存储NSData? [英] How can Core Data store an NSData?

查看:137
本文介绍了Core Data如何存储NSData?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文档说,核心数据属性只能存储NSString,NSNumber和NSDate类型。但是,很多Core Data用户声称Core Data也可以存储NSData类型。但是我在文档中看不到这一点,尽管Xcode数据建模器允许选择一个名为binary的数据类型(似乎是NSData)。



我错过了什么吗?在文档中有一个隐藏的地方,确实列出了NSData的二进制文件?

解决方案

根据文档,NSData支持作为Core Data的属性类型。您应该可以毫无问题地使用它。


The documentation says, that core data properties can only store NSString, NSNumber and NSDate types. However, a lot of Core Data users claim Core Data could also store an NSData type. But I wasn't able to see that in the documentation, although the Xcode Data Modeler allows to choose a data type called "binary" (which seems to be NSData).

Did I miss something? Is there a hidden place in the documentation that indeed lists NSData for binary stuff?

解决方案

According to the documentation, NSData is supported as an attribute type for Core Data. You should be able to use it without problems.

这篇关于Core Data如何存储NSData?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆