Re: Avoiding 'cannot find method' warnings with delegates?
Re: Avoiding 'cannot find method' warnings with delegates?
- Subject: Re: Avoiding 'cannot find method' warnings with delegates?
- From: Brent Gulanowski <email@hidden>
- Date: Sun, 18 Jul 2004 13:47:38 -0400
On Sun, 18 Jul 2004 13:22:26 +0100, Jonathan del Strother
<email@hidden> wrote:
>
Not that it matters for this single case, but isn't the control then
>
tied to the controller class? How would you do it if you wanted the
>
control to be reusable for different controllers?
>
>
>
>
On 18 Jul 2004, at 1:57, David Reed wrote:
>
>
> You can make the warning go away by casting controlDelegate to your
>
> controller class. Otherwise, the compiler just doesn't know that
>
> controlDelegate responds to -deletePreset, and the default return type
>
> in Objective-C is id.
>
>
>
> HTH,
>
> David.
>
>
The reason it can't find it is because it can't find an interface that
defines it.
Just #include the .h file -- no need to cast.
--
Brent Gulanowski
http://www.boredastronaut.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.