OGeek|极客世界-中国程序员成长平台

标题: ios - KVO 属性列表? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 09:58
标题: ios - KVO 属性列表?

在哪里可以找到 AVPlayer 的可观察属性列表? 我似乎在 Apple 文档中的任何地方都找不到它。



Best Answer-推荐答案


只有在文档告诉您这是安全/正确的行为时,您才能使用 KVO。基本上,要获得您的列表,您只需搜索“observable”或“observe”或“observing”这个词。

所以,对于 AVPlayer,请咨询 the docs ,在 status 属性文档下,我们阅读:

This property is key value observable using key-value observing

同样,在 outputObscuredDueToInsufficientExternalProtection 属性文档下,我们阅读:

You can observe changes to the value of this property using key-value observing

因此,答案是:AVPlayer 的 status 属性,以及它的 outputObscuredDueToInsufficientExternalProtection 属性,并且没有其他属性,是键值可观察的。

但是,请注意,还有其他方式可以通知 AVPlayer 的情况,例如通过调用 addPeriodicTimeObserverForInterval:queue:usingBlock:addBoundaryTimeObserverForTimes:queue:usingBlock:

关于ios - KVO 属性列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34441873/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4