gpt4 book ai didi

ios - xamarin ios 将运行多长时间?

转载 作者:行者123 更新时间:2023-12-01 19:44:59 25 4
gpt4 key购买 nike

xamarin ios 将运行多长时间?
我正在运行一个 for 循环来测试 performfetch 运行多长时间,它只运行 15 秒。有官方的时限吗?

这是我的代码

 public override void PerformFetch(UIApplication application, Action<UIBackgroundFetchResult> completionHandler)
{


for (int i = 0; i < 999999; i++)
{
Debug.WriteLine(string.Format("{0}:{1}", "i", i));
}
completionHandler(UIBackgroundFetchResult.NewData);
}

最佳答案

30 秒

引用 讨论 Apple 文档的 performFetchWithCompletionHandler: 部分

When this method is called, your app has up to 30 seconds of wall-clock time to perform the download operation and call the specified completion handler block. In practice, your app should call the completion handler block as soon as possible after downloading the needed data. If you do not call the completion handler in time, your app is terminated. More importantly, the system uses the elapsed time to calculate power usage and data costs for your app’s background downloads. If your app takes a long time to call the completion handler, it may be given fewer future opportunities to fetch data in the future.


  • https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623125-application?language=occ
  • 关于ios - xamarin ios 将运行多长时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49395132/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com