iphone - 可达性类别错误

标签 iphone

Xcode 4.2、iOS 5.0 我的项目启用了 ARC,当在我的项目中添加非 ARC Reachabilty 类时,出现以下错误:

Undefined symbols for architecture i386:
  "_SCNetworkReachabilitySetCallback", referenced from:
      -[Reachability startNotifier] in Reachability.o
  "_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
      -[Reachability startNotifier] in Reachability.o
  "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
      -[Reachability stopNotifier] in Reachability.o
  "_SCNetworkReachabilityCreateWithName", referenced from:
      +[Reachability reachabilityWithHostName:] in Reachability.o
  "_SCNetworkReachabilityCreateWithAddress", referenced from:
      +[Reachability reachabilityWithAddress:] in Reachability.o
  "_SCNetworkReachabilityGetFlags", referenced from:
      -[Reachability connectionRequired] in Reachability.o
      -[Reachability currentReachabilityStatus] in Reachability.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

最佳答案

您添加的库似乎只是为设备构建的,而不是为模拟器构建的(这就是为什么它说“找不到架构 i386”)。

找到代码并将其直接添加到您的项目中,您应该能够为设备和模拟器进行构建。

关于iphone - 可达性类别错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10052102/

相关文章:

iphone - 如何以编程方式在 iOS/iPad 上启动隐藏的应用程序?

iphone - 当我使用 resumeSchedulerAndActions 时 Sprite 跳来跳去

ios - 如何获取附近 wifi 网络的列表并能够从我们的 ios 应用程序连接到它们(为企业应用程序使用私有(private) API)?

iphone - 尝试向 iPhone 设备发送推送通知时出现错误消息 "APNS Connection Failed: 0"

iphone - 重新加载时,UILabel 在 UITableViewCell 中不刷新

objective-c - 从地址簿中删除群组

iphone - iPhone OpenGL ES 2.0 中 glReadPixels 的更快替代品

iOS UIWebview 对于屏幕来说太大了

iphone - 将UIBarButtonItem添加到iPhone SDK上的UINavigationController

iphone - 在 CoreAnimation 期间重置 UIScrollView contentOffset