• 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: Delegates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Delegates


  • Subject: Re: Delegates
  • From: Mike Abdullah <email@hidden>
  • Date: Mon, 19 May 2008 22:16:19 +0100


On 19 May 2008, at 21:23, I. Savant wrote:

On Mon, May 19, 2008 at 2:54 PM, Michael Vannorsdel <email@hidden > 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/happening without
the delegate having any say on the matter or affect on the represented
object's course of action on that matter.

Yes, but the delegating object *always* follows this pattern:

- I'm doing something for which I can ask a delegate for assistance or
advice or in which the delegate might be interested, so ...
- If I have a delegate ...
 - If the delegate responds to this particular delegate message
  - Send the message to the delegate and *wait for it to return* (ie,
it's all within the same trip around the run loop, unlike
notifications).

Um, that's wrong. To quote:

A notification center delivers notifications to observers synchronously. In other words, the postNotification:methods do not return until all observers have received and processed the notification. To send notifications asynchronously use NSNotificationQueue

Indeed, most -fooDidBar: style delegate methods are implemented via NSNotificationCenter. But of course that's just an implementation detail that probably doesn't matter to the OP.

Mike.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Delegates (From: "john darnell" <email@hidden>)
 >Re: Delegates (From: Michael Vannorsdel <email@hidden>)
 >Re: Delegates (From: "I. Savant" <email@hidden>)
 >Re: Delegates (From: Paul Sargent <email@hidden>)
 >Re: Delegates (From: "I. Savant" <email@hidden>)
 >Re: Delegates (From: Michael Vannorsdel <email@hidden>)
 >Re: Delegates (From: "I. Savant" <email@hidden>)
 >Re: Delegates (From: Michael Vannorsdel <email@hidden>)
 >Re: Delegates (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: Cocoa et al as HCI usability problem
  • Next by Date: Re: Cocoa et al as HCI usability problem
  • Previous by thread: RE: Delegates
  • Next by thread: Re: Delegates
  • Index(es):
    • Date
    • Thread