views:

64

answers:

3

Im using the standard:

[NSURLConnection sendSynchronousRequest:theRequest 
                      returningResponse:&response 
                                  error:&error];

method, but while the request is away, for both waiting for the response and downloading the data, the activity icon in the OS (very top) doesnt spin showing network activity.

Is there a flag or something I have to switch on to get it to work? Or am I not using the correct downloading technique?

Thank

Mark

+4  A: 

You need to enable that from your application.

[ UIApplication sharedApplication ].networkActivityIndicatorVisible = YES;
Macmade
be careful if you have multiple things in your application that can access the network and turn this flag on/off. A set of utility functions that reference count your use of the network (and turn the flag on/off when needed) will alleviate headaches in the future
Brent Priddy
+1  A: 

try this.

UIApplication* app = [UIApplication sharedApplication];
app.networkActivityIndicatorVisible = YES;
Gary
+3  A: 

To expand on the other answers: you have to turn the indicator on and off manually with the networkActivityIndicatorVisible property. It has nothing to do with whether and when data actually travels in and out of your app. I originally also thought iPhone automatically intercepts the network traffic and manages the indicator, but nope.

Jaanus
thanks for the explanation Jaanus
Mark