常量代表“从不".一个NSTimeInterval? [英] What constant represents "never" for an NSTimeInterval?

查看:51
本文介绍了常量代表“从不".一个NSTimeInterval?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

NSTimeInterval 是一个 double ,因此它不能采用 nil ,并且0表示应立即发生的事情.是否存在一个常量,表示从不" ...或一个天文数字,或者我应该使用-1?

NSTimeInterval is a double, thus it cannot take a nil, and 0 represents something that should happen immediately. Is there a constant that means "never"... or an astronomically huge value, or should I use -1?

推荐答案

如s.bandara所建议,使用很大的数字将时间间隔视为无限"或从不".

As suggested by s.bandara, use a very large number to treat a time interval as "infinite" or "never".

DBL_MAX 是double可以容纳的最大值.此宏在 float.h 中声明:

DBL_MAX is the largest value a double can hold. This macro is declared in float.h:

#define DBL_MAX (9.999999999999999e999)

这篇关于常量代表“从不".一个NSTimeInterval?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆