我正在尝试在我的项目中使用可达性。我添加了 Reachability.h 和 Reachability.m 文件。但是在构建项目后,xCode 向我显示了奇怪的错误:
Undefined symbols for architecture i386:
"_SCNetworkReachabilityCreateWithName", referenced from:
+[Reachability reachabilityWithHostname:] in Reachability.o
"_SCNetworkReachabilityCreateWithAddress", referenced from:
+[Reachability reachabilityWithAddress:] in Reachability.o
"_SCNetworkReachabilitySetCallback", referenced from:
-[Reachability startNotifier] in Reachability.o
-[Reachability stopNotifier] in Reachability.o
"_SCError", referenced from:
-[Reachability startNotifier] in Reachability.o
"_SCErrorString", referenced from:
-[Reachability startNotifier] in Reachability.o
"_SCNetworkReachabilitySetDispatchQueue", referenced from:
-[Reachability startNotifier] in Reachability.o
-[Reachability stopNotifier] in Reachability.o
"_SCNetworkReachabilityGetFlags", referenced from:
-[Reachability isReachable] in Reachability.o
-[Reachability isReachableViaWWAN] in Reachability.o
-[Reachability isReachableViaWiFi] in Reachability.o
-[Reachability connectionRequired] in Reachability.o
-[Reachability isConnectionOnDemand] in Reachability.o
-[Reachability isInterventionRequired] in Reachability.o
-[Reachability reachabilityFlags] in Reachability.o
我怎么解决这个问题?