Re: Compiler error - method not found on object which conforms to protocol
Thanks for your input.
On Mar 30, 2021, at 10:13, Alex Zavatone via groups.io <zav@...> wrote:
Yes, the conforming class did have the method/property implemented.
Yes the compiler warns if the conforming class does not fully implement the protocol. And of course there are required and optional aspects to a protocol. The compiler only warns about required elements that are missing.
I had all the pieces in place except for the import to inform the compiler of the methods declared in the protocol. The forward declaration in the header slightly masked the issue so that I didn’t recognize why the error was being generated.
The object was already declared as conformant
@property (readonly) id<DataSrcProto> dataSource;
But, without the actual import in the scope of the compilation unit, the compiler had no idea what methods were actually declared in the protocol.