Re: compile warning re not implementing protocol
Re: compile warning re not implementing protocol
- Subject: Re: compile warning re not implementing protocol
- From: Dennis Christopher <email@hidden>
- Date: Thu, 19 Mar 2009 09:28:33 -0400
Thanks Keary,
The wording of the warning confused me. Explicitly declaring
AppController as an implementor of the protocol solved the problem. I
did notice that I had to import the delegate protocol class header
into AppController.h--just @class was insufficient--in case anyone
else has this problem..
Dennis
On Mar 18, 2009, at 5:51 PM, Keary Suska wrote:
On Mar 18, 2009, at 10:46 AM, Dennis Christopher wrote:
All,
Not sure if the list archive search is working properly, but I find
nothing searching under 'protocol' that addresses this puzzle.
I have a class PersonalInfoController that declares a protocol and a
class AppController that implements it. The two protocol methods are
declared publicly in AppController. Why then does the following call
in AppController
[self setPersonalInfoController:[PersonalInfoController
controllerWithDelegate:self]];
Get the compiler warning
"The class AppController does not implement the
PersonalInfoControllerDelegate protocol."
Did you specify in your @interface declaration for AppController that
it adopts your protocol? If so, do you use the syntax id <protocol> to
declare a variable or parameter? That usage is non-intuitive (i.e. it
doesn't work like you might think). Better to explicitly check
conformance by calling -conformsTo: or +conformsToProtocol:.
HTH,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden