获取的属性是静态的并且不会动态更新自身是什么意思?
苹果在 NSFetchedPropertyDescription 类参考中说:
但请注意,与播放列表不同 获取的属性是静态的——确实如此 不动态更新自身 目标实体中的对象 改变。
很好,但这到底是什么意思:静态属性?不在目标实体更改中动态更新?
有人可以解释一下吗?
我的想法是,获取的属性用于弱引用。喜欢:播放列表可能引用歌曲,但播放列表并不“拥有”它们。如果播放列表被删除,歌曲永远不会因此而被删除。此外,这些歌曲没有对播放列表的反向引用,他们甚至不必知道它的存在。
好的,那么如果歌曲被删除,播放列表不会以任何方式通知?或者苹果想告诉我什么?
Apple says in the NSFetchedPropertyDescription class reference:
Note, however, that unlike a playlist
a fetched property is static—it does
not dynamically update itself as
objects in the destination entity
change.
Nice, but what exactly does that mean: static property? Not dynamically updating in the destination entity change?
Can someone explain that?
What I get in my head is that a fetched property is for weak references. Like: A playlist may reference songs, but the playlist doesnt "own" them. If the playlist gets deleted, the song's never get deleted as a consequence of that. Also, the songs have no back-reference to the playlist, they don't have to know that it even exists.
Ok, so if a song gets deleted, the playlist isn't notified in any way? Or what is Apple trying to tell me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
本质上,这意味着您必须每次手动更新获取的结果才能接收源对象的最新更改。
我刚刚查阅了您引用的文档。引用后的下一段应该说清楚:
Essentially it means that you have to manually update the fetched result every time to receive the latest changes of your source object.
I just consulted your quoted documentation. The next paragraph after your quote should make it clear: