然後將reachability.h 和 reachability.m 加到自己的專案中,並引用 systemconfiguration.framework,就可以使用了。
reachability 中定義了3種網路狀態
// the network state of the device for reachability 1.5.
typedef enum networkstatus;
// the network state of the device for reachability 2.0.
typedef enum networkstatus;
比如檢測某一特定站點的接續狀況,可以使用下面的**:
檢測當前網路環境:
// 是否wifi
+ (bool) isenablewifi
// 是否3g
+ (bool) isenable3g
連線狀態實時通知
網路連線狀態的實時檢查,通知在網路應用中也是十分必要的。接續狀態發生變化時,需要及時地通知使用者。由於reachability1.5版與2.0版有一些變化,這裡分開來說明使用方法。
[b]reachability 1.5[/b]
[b]reachability 2.0[/b]
IOS檢測網路連線狀態
然後將reachability.h 和 reachability.m 加到自己的專案中,並引用systemconfiguration.framework,就可以使用了。reachability 中定義了3種網路狀態 the network state of the device for reacha...
Android 檢測網路連線狀態
檢測是否接入網際網路 connectivitymanager cm connectivitymanager context.getsystemservice context.connectivity service networkinfo activenetwork cm.getactivenetw...
ios網路連線狀態監測
reachability是蘋果封裝的乙個用於監測網路狀態的類,同時還可以檢測出連線網路的型別 無連線,wifi,3g 非常的輕巧,易用。蘋果官方 github 使用方法 1.將解壓出來的reachability.h和reachability.m 新增到專案中。2.新增systemconfigurat...