• 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
Using notifications vs. listener lists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using notifications vs. listener lists


  • Subject: Using notifications vs. listener lists
  • From: Dave Fayram <email@hidden>
  • Date: Sat, 4 May 2002 16:11:14 -0700

Hi,
I'm working on a cocoa app that relies heavily on libpcap and I realized I have a small
design dilemma I don't know the "cocoa" solution for. My little worker thread is going to be
reading packets of the bpf and it needs to let people know when it recieves appropriate
packets from various hosts. Sometimes, there could be long periods of time without any
packets, sometimes there could be hundreds a minute. I'd like to be able to register multiple,
arbitrary listeners to respond to these events.
My first reaction is to use the NSNotificationCenter and register listeners (passing the
germane info via the userinfo field) but I don't know if I should use an NSArray of listeners
and enumerate across that. What is the "Cocoa" way here? I'd like performance to be decent
as well and I really don't know how well NSNotifications work in terms of speed.

Could someone fill me in?


- Dave "Paradox" Fayram
My ElGamal and DSA keys can be found at:
http://zero.atomictrain.net:88/~paradox/pgpkey.html

"Not everyone finds Drag'n'Drop as intuitive as they should."
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Using notifications vs. listener lists
      • From: Drew McCormack <email@hidden>
  • Prev by Date: Re: Categories
  • Next by Date: Getting File Sizes
  • Previous by thread: NSImage & NSImageRep
  • Next by thread: Re: Using notifications vs. listener lists
  • Index(es):
    • Date
    • Thread