• 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
NSNotification vs message callback?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSNotification vs message callback?


  • Subject: NSNotification vs message callback?
  • From: "l.m.orchard" <email@hidden>
  • Date: Mon, 6 Aug 2001 15:36:19 -0400

Okay, I'm working on a little class which either subclasses (not having much luck there) or wraps NSTask with a threaded read loop which slurps down the data from StandardOutput. As the data streams in, I extract complete lines with carriage returns and use an NSConnection to send each line to an object with a message in the main thread, so as to avoid GUI problems.

So. Right now, I supply the threaded task with an object and a selector for accepting these line handling messages. However, should I be using an NSNotification for this? I thought maybe, since then multiple objects could even respond to processing the line, but then I thought that this would be far too heavyweight, since the message would be broadcast every time a line came in.

And also, I was thinking of firing off a message every time a block of data was read in from the child thread, just to provide even more immediate data... and that I *definitely* thought would be too intensive using NSNotifications

Any notions on this?

--
Leslie Michael Orchard <email@hidden>
ICQ: 492905 (home) 11082089 (work)
"...see you space cowboy..."


  • Prev by Date: Beginners question regarding NSFileHandle
  • Next by Date: RE: Beginners question regarding NSFileHandle
  • Previous by thread: Re: Beginners question regarding NSFileHandle
  • Next by thread: NSNotification vs message callback?
  • Index(es):
    • Date
    • Thread