Xcode 的dispatch_after
模板
double delayInSeconds = 2.0;
double delayInNanoSeconds = delayInSeconds * NSEC_PER_SEC;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInNanoSeconds);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
});
导致以下警告
隐式转换将浮点数转换为整数:“double”到“int64_t”(又名“long long”)
因为
delayInNanoSeconds
从 a隐式转换double
为 anint64_t
这有多糟糕?