Using Apple's Reachability code in iOS5 I get a bunch of compilation errors as shown below. Any ideas on what is happening here? I'm using ARC so I have edited the standard code slightly to remove autorelease/retain
and the NSAutoReleasePool
.
Undefined symbols for architecture armv7:
"_SCNetworkReachabilityCreateWithAddress", referenced from: +[Reachability reachabilityWithAddress:] in Reachability.o
"_SCNetworkReachabilityCreateWithName", referenced from: +[Reachability reachabilityWithHostName:] in Reachability.o
"_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from: -[Reachability stopNotifier] in Reachability.o
"_SCNetworkReachabilityScheduleWithRunLoop", referenced from: -[Reachability startNotifier] in Reachability.o
"_SCNetworkReachabilitySetCallback", referenced from: -[Reachability startNotifier] in Reachability.o
"_SCNetworkReachabilityGetFlags", referenced from: -[Reachability connectionRequired] in Reachability.o -[Reachability currentReachabilityStatus] in Reachability.o
ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Does anyone have workable Reachability code for ARC under iOS5?
Apple's reachability has been updated to version 3 which now supports ARC iOS5+
Here is the link to the sample by Apple
You don't really need an ARC version of Reachability, just simply disable ARC for reachability file(s)
Disable ARC on MULTIPLE files:
You also have a missing framework. Add SystemConfiguration framework.
Tony, is your class correctly work even with a non ARC project? I can see lot ok Reachability: dealloc in my consolle, and I don't know if it's normal or not! I use this method to check the connection (is the only place where I user Rechability)
You need to add the systemConfiguration.framework to make Reachability work.
I rearranged them for IOS 5 and arc they are working tested
Please DON'T FORGET TO ADD SystemConfiguration.framework on your project
I know this thread is old, but in case anyone is interested you can solve this by disabling ARC for Reachability.m. Look at this post.