我想在ios 5.1中使用可達性,但它給了我一個Match-o Linker錯誤。 我正在使用Xcode 4.3並使用armv6和armv7構建我的應用程序。我已經讀過了Reachability對armv7不太好,這可能會導致錯誤。真的嗎? 如果是這樣,是否有任何解決方法讓我的應用程序檢查互聯網連接? 是的,我已經導入兩個iOS 5.1可達性
Reachability.h
和
SystemConfiguration.framework
我的示例實現代碼如下:在advcance
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkNetworkStatus:) name:kReachabilityChangedNotification object:nil];
internetReachable = [Reachability reachabilityForInternetConnection];
[internetReachable startNotifier];
hostReachable = [Reachability reachabilityWithHostName: @"www.apple.com"];
[hostReachable startNotifier];
謝謝!
你甚至可以用塊代替NSNotificationCenter – 2012-03-14 07:41:29
我會試試看!由於 – lsp 2012-03-16 13:52:02
是不是原來的可達性不工作對我來說,這不是觸發網絡不可達通知的問題。這個lib更好用!謝謝 – 2012-04-27 11:04:50