• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Avoiding 'cannot find method' warnings with delegates?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Avoiding 'cannot find method' warnings with delegates?


  • Subject: Re: Avoiding 'cannot find method' warnings with delegates?
  • From: Jonathan del Strother <email@hidden>
  • Date: Sun, 18 Jul 2004 13:22:26 +0100

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.

On Saturday, Jul 17, 2004, at 20:18 US/Eastern, Jonathan del Strother wrote:

I have a custom class of NSTableView. I'm using it to intercept key presses, so the user can delete rows by hitting backspace.

This should then call deletePreset on my controller class. I've set the controller class as a delegate, so I'm just calling

[controlDelegate deletePreset];

from within the custom class.

Which works fine, except when I compile I get 'cannot find method '-presetDelete'; return type 'id' assumed'.
_______________________________________________
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.



--
David Reed | email@hidden | AIM/iChat: parmadil01
_______________________________________________
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.
_______________________________________________
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.


  • Follow-Ups:
    • Re: Avoiding 'cannot find method' warnings with delegates?
      • From: Brent Gulanowski <email@hidden>
References: 
 >Re: Avoiding 'cannot find method' warnings with delegates? (From: David Reed <email@hidden>)

  • Prev by Date: Re: Get the latest song pathname played by iTunes
  • Next by Date: Re: Making an NSTextView plain text
  • Previous by thread: Re: Avoiding 'cannot find method' warnings with delegates?
  • Next by thread: Re: Avoiding 'cannot find method' warnings with delegates?
  • Index(es):
    • Date
    • Thread