本文介绍了iOS 5.1可达性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在ios 5.1中使用Reachability,但它给了我一个Match-o Linker错误。
我正在使用Xcode 4.3并使用armv6和armv7构建我的应用程序。我已经读过Reachability对armv7不好用,这可能导致错误。真的吗?
如果是这样,是否有任何解决方法让我的应用程序检查互联网连接?
是的,我已导入两个

I am trying to use Reachability in ios 5.1 but it gives me a Match-o Linker error.I am using Xcode 4.3 and building my app with armv6 and armv7. I have read that Reachability doesn't play nice with armv7, which may be causing the error. Is that true?If so, is ythere any workaround to get my app checking internet connectivity?And yes, i have imported both

Reachability.h

SystemConfiguration.framework

我的示例实现代码如下:

My sample implementation code is as below:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkNetworkStatus:) name:kReachabilityChangedNotification object:nil];
internetReachable = [Reachability reachabilityForInternetConnection];
[internetReachable startNotifier];
hostReachable = [Reachability reachabilityWithHostName: @"www.apple.com"];
[hostReachable startNotifier];

先谢谢!

推荐答案

iOS5 / GCD / ARC友好版

iOS5 / GCD / ARC friendly version

这篇关于iOS 5.1可达性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 14:14