Reachability的源代码,在一个静态库中定义,调用的地方在IOS App工程中
Reachability *reach = [[[Reachability alloc] init] autorelease];
reach.key = @"";
xcode调试报错,-[Reachability setKey:]: unrecognized selector sent to instance 0x7fdf949a2cc0
查看Reachability的源代码,确实定义了这个方法
@interface Reachability: NSObject {
@private
NSString *key_;
SCNetworkReachabilityRef reachabilityRef;
}
@property (copy) NSString *key; // Atomic because network operations are asynchronous.
......
在reach.key=@""这行代码打个断点,重新运行查看运行时Reachability的属性