Re: Question on thread communication
Re: Question on thread communication
- Subject: Re: Question on thread communication
- From: Karim Morsy <email@hidden>
- Date: Mon, 17 Apr 2006 23:38:18 +0200
Chris,
thanks for the comment on my post.
in fact, I could have just performed the method on the object
directly, but my goal was to decouple the objects as much as possible.
I think NSNotificationcenter is a great way to achieve this.
Karim
On Apr 17, 2006, at 7:51 PM, Chris Kane wrote:
To add another comment for the archives ...
It works, but there's no reason to go indirectly through the
notification center, if you have only one thing that needs to react
to the notification (though it's not clear you do, you say "handler
method" -- singular). You could just perform a method on that
object directly, passing whatever argument you like.
That avoids the indirection of the notification object (and
packaging in the userInfo dictionary whatever "results" you might
want to send from the background thread to the main thread), and
the hassle of adding the recipient object to the notification
center and removing it later.
Chris Kane
Cocoa Frameworks, Apple
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden