diff options
author | Thomas Van Lenten <thomasvl@google.com> | 2018-11-15 14:22:13 -0500 |
---|---|---|
committer | Thomas Van Lenten <thomasvl@google.com> | 2018-11-15 14:30:45 -0500 |
commit | 24bcc705890de306fd75b611bfda96500ffbd6f1 (patch) | |
tree | 1ba8158eae64cb3f1bac12bf5991a0863c1fb0f2 | |
parent | ec7da23dcde0f262ec038dd64a9aefa69b8a2cc4 (diff) |
Reorder testing of selectors.
Pick off the selector natively handled first. NSProxy's base (on my
current OS atleast) will attempt to forward things, and the fact
that the LightWeight proxy then eats the forward where there is no
target objc seems to confuse things.
This all makes the unittests fail when run in release mode, so it
just generally seems safer to reorder this.
The footnote, is NSProxy really defines a class method for this, but
since LightweightProxy doesn't have a fixed class to check with, it
can't really provide that method.
-rw-r--r-- | Foundation/GTMLightweightProxy.m | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Foundation/GTMLightweightProxy.m b/Foundation/GTMLightweightProxy.m index aa2d1a1..e1cb457 100644 --- a/Foundation/GTMLightweightProxy.m +++ b/Foundation/GTMLightweightProxy.m @@ -93,11 +93,10 @@ // Checks the represented object's selectors to allow clients of the proxy to // do respondsToSelector: tests. - (BOOL)respondsToSelector:(SEL)selector { - if ([super respondsToSelector:selector] || - selector == @selector(initWithRepresentedObject:) || + if (selector == @selector(initWithRepresentedObject:) || selector == @selector(representedObject) || - selector == @selector(setRepresentedObject:)) - { + selector == @selector(setRepresentedObject:) || + [super respondsToSelector:selector]) { return YES; } |