在Core Data中,应该用于NSManaged对象的URI属性类型是什么? [英] In Core Data, what is the URI property type on the NSManaged object supposed to be used for?
问题描述
- 为什么需要URI类型?
- URI属性的等效Swift对象类型是什么?
- 我是否将URL存储在此属性中?
- 我是否曾经想过以这种方式存储另一个托管对象的URI,但是否与此有关?
此外,指向描述用法的任何Apple文档的链接也会很有帮助。
在
为什么需要URI类型?
要存储URL。
URI属性的等效Swift对象类型是什么?
与 NSURL
等效的Swift是 URL
。
我是否将URL存储在此属性中?
我怀疑我曾经会想以这种方式存储另一个托管对象的URI,但是它是否相关?
可能,但可能不是一个好方法理念。关系会更好。尽管如此,在某些情况下这样做还是有意义的。
- Why would you need the URI type?
- What is the equivalent Swift object type for a URI property?
- Would I store a URL in this property?
- I'm doubtful that I would ever want to store the URI for another managed object in this way, but is it related?
Also, a link to any Apple docs that describe the usage would be helpful.
In the WWDC 2017 "What's New in Core Data" session, one of the slides indicates:
Why would you need the URI type?
To store a URL.
What is the equivalent Swift object type for a URI property?
The Swift equivalent of NSURL
is URL
.
Would I store a URL in this property?
That is the purpose of the type.
I'm doubtful that I would ever want to store the URI for another managed object in this way, but is it related?
Possible, but probably not a good idea. A relationship would be better. Still, there might be cases where it makes sense to do this.
这篇关于在Core Data中,应该用于NSManaged对象的URI属性类型是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!