小编Swi*_*Dev的帖子

进行网络调用时如何解决Xcode中的display_timer_callback错误?

我在 Xcode 控制台中遇到一个我以前从未遇到过的错误。当我滚动 tableView 时会发生这种情况(当我到达列表底部时,它会调用loadMoreRecipe()进行网络调用以获得更多结果的方法,错误不会出现在每次调用中,而是随机出现),但我没有改变任何重要的代码。

这是有问题的错误:

2019-07-07 22:10:57.586543+0200 P10_Reciplease[6188:2107230][WindowServer] display_timer_callback:意外状态(现在:50d5cc1f65a < 预期:50d5cc80a6c)

func loadMoreRecipes(indexPath: Int) {
    print(indexPath + 1)
    guard indexPath == hits.count - 1 else { return }
    guard let apiHelper = apiHelper else { return }
    print("le nombre total de recette est : ", hits.count)
    apiHelper.from = hits.count + 1
    apiHelper.to = apiHelper.from + 10

    startAnimatingActivityIndicator()

    apiHelper.getRecipe(userIngredients: userIngredients, callback: { [weak self] (apiResult, statusCode)  in
        guard let apiResult = apiResult else {

            apiHelper.from = self?.hits.count ?? …
Run Code Online (Sandbox Code Playgroud)

api xcode runtime-error callback swift

7
推荐指数
0
解决办法
362
查看次数

标签 统计

api ×1

callback ×1

runtime-error ×1

swift ×1

xcode ×1