zuccoi / REKit

A collection of NSObject extensions that brings out Blocks latent ability.
MIT License
128 stars 6 forks source link

setConformable:toProtocol:withKey: not working? #3

Closed lingnand closed 11 years ago

lingnand commented 11 years ago

I see this method under NSObject + REResponder; it's not documented in README, but I thought this might be really helpful if I want to make an object conform to a particular protocol. However the object I tried with does not respond YES to conformsToProtocol: after applying this method. Is this supposed to do what I suppose it to do?

lingnand commented 11 years ago

After more trying I found that it does work if I give it a key for withKey: What is this key supposed to do?

However this only makes the object conform to the specified protocol, and not to ones that are incorporated in that protocol.

zuccoi commented 11 years ago

Currently, key argument is required for setConformable:toProtocol:withKey:. If you call the method, receiver will return YES by -conformsToProtocol: for specified protocol only. Key argument is intended to be used when you tear down previous request.

I'll make key argument optional, and support incorporated protocols.

Thank you for your suggestion.

zuccoi commented 11 years ago

I fixed #3. For specifications and behaviors around -setConformable:toProtocol:withKey:, please see -test_setConformableToProtocol… methods in REResponderLogicTests.m.