简体   繁体   中英

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM