Re: compile warning re not implementing protocol
Re: compile warning re not implementing protocol
- Subject: Re: compile warning re not implementing protocol
- From: Keary Suska <email@hidden>
- Date: Wed, 18 Mar 2009 15:51:56 -0600
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