ReactiveCocoa/ReactiveCocoa — pull request #926 by ikesyo (2013-11-08 03:18:21+00:00)
Title: Fix to -rac_signalForSelector: properly implement -respondsToSelector: for optional method from a protocol

If an instance is callded `-rac_signalForSelector:fromProtocol:` for a certain protocol's optional method (its class doesn't implement that), the instance should respond to the selector. Then, another instance of the same class that is called `-rac_signalForSelector:` with other selectors, but not called with the optional method selector, should not respond to the selector.

Originally, `class_addMethod()` makes all instances of the class respondable to the optional method selector. It leads to a crash from `-doesNotRecognizeSelector:` at [RACSwizzleForwardInvocation](https://github.com/ReactiveCocoa/ReactiveCocoa/blob/ce203085482d027ef47199b913f5ba6475b5bf81/ReactiveCocoaFramework/ReactiveCocoa/NSObject%2BRACSelectorSignal.m#L81-L85) in following pattern:

```objc
if ([anotherInstance respondsToSelector:@selector(someOptionalMethod:)]) {
// The instance responds to the selector, but it doesn't have a signal for the selector.
// So, `RACForwardInvocation()` returns NO.
[anotherInstance someOptionalMethod:@1];
}
```