• 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: notifications vs delegates (was: The fuzzy aspects of Cocoa)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: notifications vs delegates (was: The fuzzy aspects of Cocoa)


  • Subject: Re: notifications vs delegates (was: The fuzzy aspects of Cocoa)
  • From: Jay Kuri <email@hidden>
  • Date: Thu, 28 Feb 2002 01:22:01 -0600

1) The app registers one (or several) of it's objects to receive notifications and the framework builds the notification names dynamically.
I don't see why the *names* of the notifications need to change.
They _could_ be different on an app by app basis. Different network message request types would cause different notifications. The notification names would reflect this so that different objects could deal with different request types without needing to have a single object receive the notification and farm it out based on type.

or 2) Have the framework use a dictionary or other container holding a series of (id *)'s and using an informal (or formal) protocol to deliver the messages via method calls. (of course, the objects would have to register themselves with my object in this case)
..in which case you're re-implementing the NSNotification/NSNotificationCenter classes.
right. best to stick with something people already know and understand. I'm not a big fan of 'reinvent it here' anyway. ;-)

How would you do it?
Probably the way that NSTask does. You send a notification whenever one of your packets arrives.
That's how I'm going to do it I think. It just makes the most sense.

Thanks again for all your help,

Jay
_______________________________________________
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.

References: 
 >Re: notifications vs delegates (was: The fuzzy aspects of Cocoa) (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Multiple windows in a doc based app How-To
  • Next by Date: Two basic questions
  • Previous by thread: Re: notifications vs delegates (was: The fuzzy aspects of Cocoa)
  • Next by thread: Re: No ftp:// support in NSURL?
  • Index(es):
    • Date
    • Thread