How can Core Data store an NSData?

2020-04-04 13:03发布

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?

2条回答
姐就是有狂的资本
2楼-- · 2020-04-04 13:47

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

查看更多
劳资没心,怎么记你
3楼-- · 2020-04-04 13:49

Please review my answer to your other nearly identical question regarding binary size in the model.

查看更多
登录 后发表回答