Re: The Unadopted Protocol

2010-06-05 Thread Matt Neuburg
On or about 6/2/10 11:11 AM, thus spake "Greg Parker" : > On Jun 2, 2010, at 8:57 AM, Matt Neuburg wrote: >> So this appears to be a technique for implementing a highly informal >> protocol. (The technique is: define a protocol, don't bother adopting it >> anywhere, but send messages defined in th

Re: The Unadopted Protocol

2010-06-02 Thread Matt Neuburg
On or about 6/2/10 11:11 AM, thus spake "Greg Parker" : > On Jun 2, 2010, at 8:57 AM, Matt Neuburg wrote: >> So this appears to be a technique for implementing a highly informal >> protocol. (The technique is: define a protocol, don't bother adopting it >> anywhere, but send messages defined in th

Re: The Unadopted Protocol

2010-06-02 Thread Greg Parker
On Jun 2, 2010, at 8:57 AM, Matt Neuburg wrote: > So this appears to be a technique for implementing a highly informal > protocol. (The technique is: define a protocol, don't bother adopting it > anywhere, but send messages defined in that protocol to an id.) Yep. When the compiler looks for a met

Re: The Unadopted Protocol

2010-06-02 Thread Quincey Morris
On Jun 2, 2010, at 08:57, Matt Neuburg wrote: > So this appears to be a technique for implementing a highly informal > protocol. What's the problem that this technique is intended to solve? This is one of several techniques that can be used to send an arbitrary message to an arbitrary object wi

Re: The Unadopted Protocol

2010-06-02 Thread John Johnson
> This compiles and runs fine, even though MyClass never adopted the protocol > Unadopted. It take it that by casting mc to an id, I cause the compiler to > grasp at the only signature for "testing" that it knows about, namely the > one in the protocol. So it happily uses that signature without co

Re: The Unadopted Protocol

2010-06-02 Thread Kevin Wojniak
I've used this when compiling code for both 10.6 and below to avoid protocol errors. Seems to do the trick. Kevin On Jun 2, 2010, at 8:57 AM, Matt Neuburg wrote: Here's something I stumbled on by accident. Consider the following: // MyClass.h #import @interface MyClass : NSObject { } @e

Re: The Unadopted Protocol

2010-06-02 Thread Dave DeLong
Mostly d, but partly f. It's d in that it's well-known that you can send any message you want to an id, but f in that the scenario you came up with is a slightly unusual one. Dave On Jun 2, 2010, at 9:57 AM, Matt Neuburg wrote: > Here's something I stumbled on by accident. Consider the follow