Search code examples
iphoneobjective-cnetwork-programmingindicatorcfnetwork

Network Activity indicator should be always active?


I am using network activity indicator in an iphone project . the problem is even when there is no send and receive in my app the indicator is spinning and only stops when network is disconnected .

Can anyone tell is it because of any hidden activity or network activity indicator behavior is like this !!! Do you have any solution for this problem ?

I need to inform my user about network activity ....

EDIT : the problem is I am not sure about the usage of Network activity indicator, or in other word I dont know when the network activity is spinning , does it mean there is an activity or just it shows the connection is not down !

thanks


Solution

  • I Found the answer for this problem from this website : http://iosdevelopertips.com/cocoa/showing-network-activity-when-there-isn%E2%80%99t-any.html

    // start the indicator ... [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;

    // Do something that may take some time to complete ...

    // stop the indicator ... [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;