Show & Hide Loading/Processing Indicator in iPhone App

To show the loading or processing indicator in your iPhone Application just add this line:

[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;

and to hide the loading indicator use the same with changing  YES to NO, like this:

[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;

You will need to use this feature normally when you are processing something in background using thread(I will try to write about thread later Inshallah) and you want user to know that something is going on in background.

thats it;

Advertisements

5 Responses to Show & Hide Loading/Processing Indicator in iPhone App

  1. This was easy! looking forward for more lessons from you about the thread =) will be following you here =)

  2. iNouf says:

    Thanks a lot!
    where should it be added? viewController?

    • There is no specific place for it. Wherever you do some process (especially in background) drop the showing line .. and where process ends put the hiding line.

      I will put the a link to download the project in this post. But I am not sure if you will be able to try because the application is using a temporary web-service created for training purpose only and will be disabled very soon .. so hurry up. 🙂

  3. Sorry guys I think I dont have the rights to publish the code here since it use the training agent web-service 😦

    I will do that inshallah when I create my own web-service .. soon 😀

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: