为什么我的网络活动图标没有出现在我的iPhone应用中

时间:2021-11-24 20:28:41

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

马克

3 个解决方案

#1


5  

You need to enable that from your application.

您需要从应用程序中启用它。

[ UIApplication sharedApplication ].networkActivityIndicatorVisible = YES;

#2


3  

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.

要展开其他答案:您必须使用networkActivityIndicatorVisible属性手动开关指示器。它与数据是否以及何时真正进出你的应用没有关系。我原本还以为iPhone会自动拦截网络流量并管理指示器,但没有。

#3


1  

try this.

试试这个。

UIApplication* app = [UIApplication sharedApplication];
app.networkActivityIndicatorVisible = YES;

#1


5  

You need to enable that from your application.

您需要从应用程序中启用它。

[ UIApplication sharedApplication ].networkActivityIndicatorVisible = YES;

#2


3  

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.

要展开其他答案:您必须使用networkActivityIndicatorVisible属性手动开关指示器。它与数据是否以及何时真正进出你的应用没有关系。我原本还以为iPhone会自动拦截网络流量并管理指示器,但没有。

#3


1  

try this.

试试这个。

UIApplication* app = [UIApplication sharedApplication];
app.networkActivityIndicatorVisible = YES;