【发布时间】:2012-03-14 02:20:11
【问题描述】:
我正在尝试在 ios 5.1 中使用可达性,但它给了我一个 Match-o Linker 错误。 我正在使用 Xcode 4.3 并使用 armv6 和 armv7 构建我的应用程序。我读过 Reachability 与 armv7 不兼容,这可能会导致错误。真的吗? 如果是这样,是否有任何解决方法可以让我的应用程序检查互联网连接? 是的,我都进口了
Reachability.h
和
SystemConfiguration.framework
我的示例实现代码如下:
[[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 reachability xcode4.3