我正在测试测量剩余的后台任务时间剩余时间。 我已经阅读了几个例子,看到每个人都这样做:
UIApplication *app = [UIApplication sharedApplication]; double *bgTime = app.backgroundTimeRemaining; NSLog(@"Background Time Remaining: %f", bgTime);但我得到很长的价值,如1797693134862315708145274237317043567980705675258449965989 ...
我知道[[UIApplication sharedApplication] backgroundTimeRemaining]是NSTimeInterval,但有没有办法将其转换为x秒?
我也试过这个 ,但它不会起作用。
任何帮助,将不胜感激。 谢谢。
I'm running test on measuring how much time left for background task time remaining. I have read several examples and saw that everyone doing it like:
UIApplication *app = [UIApplication sharedApplication]; double *bgTime = app.backgroundTimeRemaining; NSLog(@"Background Time Remaining: %f", bgTime);But I get very long value like 1797693134862315708145274237317043567980705675258449965989...
I understand that [[UIApplication sharedApplication] backgroundTimeRemaining] is NSTimeInterval, but is there any way to convert this to just x seconds?
I have also tried this, but it won't work.
Any help would be appreciated. Thank you.
最满意答案
如果应用程序位于前台,则根据此处的文档,时间将会很长。
If the application is in the foreground, the time will be large as per documentation here.
更多推荐
发布评论