开发者

How to use 2 Reachability class's together in one project?

开发者 https://www.devze.com 2023-02-28 18:38 出处:网络
I\'m trying to check the network reachability with the following code found here on stackoverflow. The only problem is that I al开发者_如何学JAVAready have the reachability classes in my project due t

I'm trying to check the network reachability with the following code found here on stackoverflow. The only problem is that I al开发者_如何学JAVAready 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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消