RE: Delegates

2008-05-20 Thread john darnell
Sigh. So I'm dating myself with the comment about dating myself... (playful grin) R, John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff LaMarche Sent: Monday, May 19, 2008 4:04 PM To: Cocoa Developers Subject: Re: Delegates On May 19, 200

Re: Delegates

2008-05-19 Thread Mike Abdullah
On 19 May 2008, at 21:23, I. Savant wrote: On Mon, May 19, 2008 at 2:54 PM, Michael Vannorsdel <[EMAIL PROTECTED] > wrote: There's nothing that guarantees a Cocoa delegate will act for another object and that the represented object won't act how it wants as well. Sometimes a delegate metho

Re: Delegates

2008-05-19 Thread Jeff LaMarche
On May 19, 2008, at 5:00 PM, john darnell wrote: yeah, I know...I'm dating myself with the use of the word "grok" Huh? You're not dating anything. :P I think grok gets used on this list at least a few times a week. Grok is part of the geek lexicon, even among people who have no idea wher

RE: Delegates

2008-05-19 Thread john darnell
I believe it was Carl Jung who said that ideas needed meathooks in the mind to help us retain/organize our thoughts and many of you have helped me figure out the right meathooks to use when attempting to grok the meaning of delegates (yeah, I know...I'm dating myself with the use of the word "grok

Re: Delegates

2008-05-19 Thread ben syverson
On May 19, 2008, at 1:54 PM, Michael Vannorsdel wrote: I'm just saying Cocoa delegates don't always act in dictionary form. I know this discussion can go round and round, but I still think reading the english dictionary for delegates won't tell you the whole story on Cocoa delegates. Wit

Re: Delegates

2008-05-19 Thread Michael Vannorsdel
Ditto, I'll surrender the last word to you. Though I'm interested to know if the OP is having any success or not. This thread got a little sidetracked. On May 19, 2008, at 2:23 PM, I. Savant wrote: I think that's the last I'll comment on the dictionary definition matter; it's a silly arg

Re: Delegates

2008-05-19 Thread I. Savant
On Mon, May 19, 2008 at 2:54 PM, Michael Vannorsdel <[EMAIL PROTECTED]> wrote: > There's nothing that guarantees a Cocoa delegate will act for another object > and that the represented object won't act how it wants as well. Sometimes a > delegate method is just a notification something happened/ha

Re: Delegates

2008-05-19 Thread Andy Lee
On May 19, 2008, at 2:54 PM, Michael Vannorsdel wrote: I know this discussion can go round and round, but I still think reading the english dictionary for delegates won't tell you the whole story on Cocoa delegates. There's also Wikipedia:

Re: Delegates

2008-05-19 Thread Andy Lee
D'oh, I see that point was already made. --Andy On May 19, 2008, at 2:52 PM, Andy Lee wrote: Another difference between delegates and observers is that delegates sometimes have the power of veto over some operation (e.g., - applicationShouldTerminate: and -textShouldEndEditing:), whereas o

Re: Delegates

2008-05-19 Thread Jens Alfke
On 19 May '08, at 9:22 AM, john darnell wrote: As far as I can tell, it is kind of like a virtual function (virtual because I, the programmer, am expected to flesh it out) that resembles an event attached to a given class. You're basically correct, but I think you're overcomplicating the co

Re: Delegates

2008-05-19 Thread Michael Vannorsdel
There's nothing that guarantees a Cocoa delegate will act for another object and that the represented object won't act how it wants as well. Sometimes a delegate method is just a notification something happened/happening without the delegate having any say on the matter or affect on the re

Re: Delegates

2008-05-19 Thread Andy Lee
Another difference between delegates and observers is that delegates sometimes have the power of veto over some operation (e.g., - applicationShouldTerminate: and -textShouldEndEditing:), whereas observers of notifications are merely notified. --Andy On May 19, 2008, at 1:41 PM, I. Savant w

Re: Delegates

2008-05-19 Thread I. Savant
> In this respect, an object is entrusting a task or responsibility to > something else that has no direct control over the 'superior' object's > workings, but the 'superior' object is relying on the 'delegate' to > perform some task if necessary or to find something out and let it's > 'superior'

Re: Delegates

2008-05-19 Thread I. Savant
On Mon, May 19, 2008 at 2:00 PM, Michael Vannorsdel <[EMAIL PROTECTED]> wrote: > Even delegation is not a commonly known term in my experience (it's used for > several differing ideas in the US). Not sure what you mean there. To 'delegate' is to "entrust (a task or responsibility) to another

Re: Delegates

2008-05-19 Thread Michael Vannorsdel
Even delegation is not a commonly known term in my experience (it's used for several differing ideas in the US). I try my best to give terms and examples with the best chance of grasping, especially with beginner concepts. Even the truest term of delegate doesn't perfectly fit Cocoa deleg

Re: Delegates

2008-05-19 Thread I. Savant
On Mon, May 19, 2008 at 1:37 PM, Michael Vannorsdel <[EMAIL PROTECTED]> wrote: > Indeed. I was just trying to keep it in simple terms as not to overwhelm > the OP with heavy details. I just wanted the concept to make some sense in > better known terms at the risk of oversimplifying. I figured

Re: Delegates

2008-05-19 Thread I. Savant
> I think that was 'observers', not 'Observers'. > (i.e. not in the Cocoa/KVO sense) > > Sometimes wonder if we're going to run out of words to describe things > because everything is overloaded with some technical meaning. > Still ... my point is the same. I think this is a semantics argument w

Re: Delegates

2008-05-19 Thread Michael Vannorsdel
Indeed. I was just trying to keep it in simple terms as not to overwhelm the OP with heavy details. I just wanted the concept to make some sense in better known terms at the risk of oversimplifying. On May 19, 2008, at 11:01 AM, I. Savant wrote: Well, no, not really. This is significantl

Re: Delegates

2008-05-19 Thread Paul Sargent
On 19 May 2008, at 18:01, I. Savant wrote: On Mon, May 19, 2008 at 12:52 PM, Michael Vannorsdel <[EMAIL PROTECTED] > wrote: Delegates act like observers. Well, no, not really. I think that was 'observers', not 'Observers'. (i.e. not in the Cocoa/KVO sense) Sometimes wonder if we're going

Re: Delegates

2008-05-19 Thread Paul Sargent
On 19 May 2008, at 17:22, john darnell wrote: As far as I can tell, it is kind of like a virtual function (virtual because I, the programmer, am expected to flesh it out) that resembles an event attached to a given class. You're in the right ball park. The bit you're missing is that with vir

Re: Delegates

2008-05-19 Thread Nate Weaver
Delegates *are* often automatically registered for their delegated object's notifications, however. The differences between these and "regular" delegate methods should be apparent in the documentation, though, since the former will take a single argument of NSNotification *. (To help the

Re: Delegates

2008-05-19 Thread I. Savant
On Mon, May 19, 2008 at 12:52 PM, Michael Vannorsdel <[EMAIL PROTECTED]> wrote: > Delegates act like observers. They register with another object saying > "hey, if you do something important I want to know about it and have a > chance to act on it too". Well, no, not really. This is significant

Re: Delegates

2008-05-19 Thread Michael Babin
On May 19, 2008, at 11:22 AM, john darnell wrote: I've been trying to get my head wrapped around the concept of "delegates" and I thought I would run it by the list to see if I am approaching the correct idea behind a delegate. As far as I can tell, it is kind of like a virtual function (vi

Re: Delegates

2008-05-19 Thread I. Savant
> I've been trying to get my head wrapped around the concept of > "delegates" and I thought I would run it by the list to see if I am > approaching the correct idea behind a delegate. Is there something about your question this document doesn't address? http://developer.apple.com/documentatio

Re: Delegates

2008-05-19 Thread Michael Vannorsdel
Delegates act like observers. They register with another object saying "hey, if you do something important I want to know about it and have a chance to act on it too". Each class that allows delegates have a list of delegate methods. These are the methods the class is willing to notify t

Re: Delegates

2008-05-19 Thread Nate Weaver
A delegate is simply another object that is asked for more information or asked to do something (often optional) on behalf of the sender or in response to something the sender does (e.g., a window resize, or a table asking whether its selection can change). So, if I'm correctly reading what