“failed to resume in time” on resumption from background crash

前端 未结 1 636
星月不相逢
星月不相逢 2021-01-15 11:08

ok so on going to background I hide everything. I still get a failed to resume in time error when I switch back. Why is it crashing in drawRect if everything is hidden?

相关标签:
1条回答
  • 2021-01-15 11:50

    Use Instruments (specifically Shark) to find out what is going on.

    The reason Springboard is killing your app is because you are coming close to exceeding the allowed 10 seconds (Apple never seems to publish what the exact number is, but general wisdom seems to have it pegged at 10).

    Elapsed total CPU time (seconds): 9.880 (user 7.320, system 2.560), 97% CPU 
    

    When the program crashes, it may be doing some drawing - how do you know that it's not doing some other task for 8 seconds and then doing drawing for 1.5? That's where I'd use Shark to find out what's taking the most percentage of CPU time.

    Then, analyze that to see what can be done about it.

    0 讨论(0)
提交回复
热议问题