When writing Cocoa and implementing a class method that accepts a delegate and one or more selectors to use for its callbacks, does the terminology change from "delegate" and "selectors" to "target" and "action"? More to the point, is "delegate" limited only to when my class is the one getting called, but not when my class is doing the calling?
+3
A:
Delegates are usually implemented using Protocols instead of selectors. This is a more formal way of communicating across classes, and is mostly useful when there is more than one method that may be needed.
Target/Action are generally used to correspond to an "event-like" situation, such as a click, a timer firing, etc.
NilObject
2009-06-14 04:50:52
I get it now -- I'm doing it wrong. That would be why it's confusing to me :)Also of assistance was this page, covering the "methodName not in protocol" error I ran into almost immediately:http://www.mobileorchard.com/idprotocol-retainrelease-and-protocol-inheritance/
Collin Allen
2009-06-14 05:38:57