如何在一个项目中同时使用 2 个 Reachability 类?
我正在尝试使用 stackoverflow。唯一的问题是,由于使用 ASIHTTPRequest 类,我的项目中已经有了可达性类。由于以下错误,我无法使用 Apple 的默认可达性代码来构建我的项目:
"_kReachabilityChangedNotification", referenced from:
_kReachabilityChangedNotification$non_lazy_ptr in ASIHTTPRequest.o
(maybe you meant: _kReachabilityChangedNotification$non_lazy_ptr)
(maybe you meant: _kReachabilityChangedNotification$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status
我想我的问题是如何获取此代码 此处使用 ASIHTTPRequest 的 Reachability 类?谢谢。
I'm trying to check the network reachability with the following code found here on stackoverflow. The only problem is that I already have the reachability classes in my project due to using the ASIHTTPRequest classes. I'm unable to get my project to build by using Apple's default Reachability code due to the following errors:
"_kReachabilityChangedNotification", referenced from:
_kReachabilityChangedNotification$non_lazy_ptr in ASIHTTPRequest.o
(maybe you meant: _kReachabilityChangedNotification$non_lazy_ptr)
(maybe you meant: _kReachabilityChangedNotification$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status
I guess my question is how can I get this code here work with the ASIHTTPRequest's Reachability class? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ASIHTTPRequest 类使用的“Reachability”类与苹果的 Reachability 类相同。您收到此错误是因为您可能有
1) 忘记添加“MobileCoreServices.framework”
2) 或“CFNetwork.framework”
3) 以及最后但并非最不重要的“libz.1.2.3.dylib”库。
让我知道这是否有帮助。
The 'Reachability' class used by ASIHTTPRequest's classes are the same as apple's Reachability class. You are getting this error because you might have
1) Forgot to add 'MobileCoreServices.framework'
2) or 'CFNetwork.framework'
3) and last but not the least 'libz.1.2.3.dylib' library.
Let me know if this helps.
最好重新构建项目和 ASIHTTPRequest 库都依赖于可达性,以避免重复。
无论如何,快速而肮脏的方法就是在任一位置重命名可达性类。
Better to resturcture to make both the project and ASIHTTPRequest lib depends upon reachability to avoid the duplication.
Anyway the quick the dirty way is just to rename reachability class in either place.