Does UIActivityIndicator require manual threading on iPhone

前端 未结 5 764
滥情空心
滥情空心 2020-12-13 02:56

I am running creating an iPhone application which performs a costly operation and I wanted to create an activityIndicator to let the user know the application has not frozen

5条回答
  •  情话喂你
    2020-12-13 03:56

    Which is easier:

    1> Have 1 method that starts the spinner (in the background).
    2> Run your long-running code right here.
    3> Have 1 method that ends the spinner.
    

    or....

    A> Have 1 method that starts the spinner.
    B> Have 20 methods (1 for each thing you want to do in the background)
    C> Have 1 method that ends the spinner.
    

    I always see everyone suggest A,B,C... the hard way.

提交回复
热议问题