ios – CMTimeCompare如何工作?

CMTimeCompare如何工作? Apple似乎已经从他们的文档中遗漏了返回值.

https://developer.apple.com/library/mac/#documentation/CoreMedia/Reference/CMTime/Reference/reference.html

我假设如果时间相等则返回零并返回正或负1,基于哪个更大?

解决方法

来自CMTime.h:

Returns the numerical relationship (-1 = less than,1 = greater than,
0 = equal) of two CMTimes.

-1 is returned if time1 is less than time2. 0 is returned if they are equal. 1 is returned if time1 is greater than time2.

编辑:

请注意:

Invalid CMTimes are considered to be equal to other invalid CMTimes,and greater than any other CMTime. Positive infinity is considered to be less than any invalid CMTime,equal to itself,and greater than any other CMTime. An indefinite CMTime is considered to be less than any invalid CMTime,less than positive infinity,and greater than any other CMTime. Negative infinity is considered to be equal to itself,and less than any other CMTime.

相关文章

背景 前端时间产品经理决定使用百度统计,使得 工程B 中原统计sdk-友盟统计,需要被去除。之前尝试去除...
结论: alloc负责分配内存和创建对象对应的isa指针; init只是返回alloc生成的对象。 所以alloc后,多次...
更新 如果UI愿意把启动图切割成n份,按一定约束在launchscreen.storyboard中进行排版,启动图效果会更好...
最近在看一本书《Effective OC 2.0》,今天看到有个tip是OC适中循环各自优劣性,作者最终推荐此块循环。...
// // ViewController.m // paintCodeTestOC //gif // Created by LongMa on 2019/7/25. // #import &a...
背景介绍 一般情况下,出于省电、权限、合理性等因素考虑,给人的感觉是很多奇怪的需求安卓可以实现,但...