【发布时间】:2011-10-17 16:56:27
【问题描述】:
在 iOS5 中使用 Apple 的 Reachability 代码我得到一堆编译错误,如下所示。关于这里发生的事情有什么想法吗?我正在使用 ARC,所以我稍微编辑了标准代码以删除 autorelease/retain 和 NSAutoReleasePool。
架构 armv7 的未定义符号:
“_SCNetworkReachabilityCreateWithAddress”,引用自: +[ReachabilityreachabilityWithAddress:] 在 Reachability.o
“_SCNetworkReachabilityCreateWithName”,引用自: +[ReachabilityreachabilityWithHostName:] 在 Reachability.o
“_SCNetworkReachabilityUnscheduleFromRunLoop”,引用自: -Reachability.o 中的[Reachability stopNotifier]
“_SCNetworkReachabilityScheduleWithRunLoop”,引用自: -Reachability.o中的[Reachability startNotifier]
“_SCNetworkReachabilitySetCallback”,引用自: -Reachability.o中的[Reachability startNotifier]
“_SCNetworkReachabilityGetFlags”,引用自: -Reachability.o 中的[Reachability connectionRequired] -Reachability.o中的[Reachability currentReachabilityStatus]
ld:未找到架构 armv7 clang 的符号:错误:链接器 命令失败,退出代码为 1(使用 -v 查看调用)
有没有人在 iOS5 下有可行的 ARC 可达性代码?
【问题讨论】:
-
您可以对某些文件关闭 ARC。看这个答案stackoverflow.com/questions/6308425/…
-
所有这些答案,如果不是全部的话,大部分都是完全有效的,但您还没有将其中一个标记为正确?
标签: wifi ios5 reachability automatic-ref-counting