FROM : Mike Abdullah
DATE : Mon May 19 23:16:19 2008
On 19 May 2008, at 21:23, I. Savant wrote:
> On Mon, May 19, 2008 at 2:54 PM, Michael Vannorsdel <<email_removed>
> > 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.
DATE : Mon May 19 23:16:19 2008
On 19 May 2008, at 21:23, I. Savant wrote:
> On Mon, May 19, 2008 at 2:54 PM, Michael Vannorsdel <<email_removed>
> > 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.
| Related mails | Author | Date |
|---|---|---|
| john darnell | May 19, 18:22 | |
| Michael Vannorsdel | May 19, 18:52 | |
| Nate Weaver | May 19, 18:52 | |
| I. Savant | May 19, 18:58 | |
| Michael Babin | May 19, 18:59 | |
| I. Savant | May 19, 19:01 | |
| Paul Sargent | May 19, 19:30 | |
| Nate Weaver | May 19, 19:30 | |
| Paul Sargent | May 19, 19:35 | |
| Michael Vannorsdel | May 19, 19:37 | |
| I. Savant | May 19, 19:41 | |
| I. Savant | May 19, 19:41 | |
| Michael Vannorsdel | May 19, 20:00 | |
| I. Savant | May 19, 20:25 | |
| I. Savant | May 19, 20:31 | |
| Andy Lee | May 19, 20:52 | |
| Michael Vannorsdel | May 19, 20:54 | |
| Jens Alfke | May 19, 21:01 | |
| Andy Lee | May 19, 21:01 | |
| Andy Lee | May 19, 21:07 | |
| I. Savant | May 19, 22:23 | |
| Michael Vannorsdel | May 19, 22:42 | |
| ben syverson | May 19, 22:50 | |
| john darnell | May 19, 23:00 | |
| Jeff LaMarche | May 19, 23:04 | |
| Mike Abdullah | May 19, 23:16 | |
| john darnell | May 20, 15:58 |






Cocoa mail archive

