My iOS app freezes but no error appears

后端 未结 5 1697
时光取名叫无心
时光取名叫无心 2021-02-03 13:43

Does any body know what I need to check if app freezes after some time? I mean, I can see the app in the iPhone screen but no view responds.

I did some google and i fou

5条回答
  •  日久生厌
    2021-02-03 13:50

    Generally, it is highly recommended to perform on the main thread all animations method and interface manipulation, and to put in background tasks like download data from your server, etc...

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        //here everything you want to perform in background
    
        dispatch_async(dispatch_get_main_queue(), ^{ 
            //call back to main queue to update user interface
        });
    });
    

    Source : http://www.raywenderlich.com/31166/25-ios-app-performance-tips-tricks

提交回复
热议问题