• 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: inter-object communication
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inter-object communication


  • Subject: Re: inter-object communication
  • From: Nicko van Someren <email@hidden>
  • Date: Wed, 29 Oct 2008 10:33:44 +0000

On 29 Oct 2008, at 06:30, Charles Steinman wrote:
From: Albert Jordan <email@hidden>

What is the recommended way for Object B to inform Object A that it is
done processing a request for the following scenario?


Object A has a list of phone numbers to send SMS messages
Object B implements sending an SMS message to a given phone number
I think a delegate is the usual Cocoa pattern for this kind of situation. You could have Object B send Object A an - objectB:didSendSMSMessage:toNumber: message or something along those lines.

A delegate certainly seems to be the appropriate model here; delegates work well when there is usually one, and never more than one, object interested in the information. If you have a situation where there might well me more than one or less than one interested object (e.g. object B noticed that the phone that might send the message has been disconnected) then posting a notification might be a better model; any interested party can then subscribe to that notification.


	Cheers,
		Nicko

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: inter-object communication (From: Charles Steinman <email@hidden>)

  • Prev by Date: Parsing xml files in Cocoa applications
  • Next by Date: interface builder and nsarraycontroller binding newbie question
  • Previous by thread: Re: inter-object communication
  • Next by thread: Problem with NSData to NSString to NSData
  • Index(es):
    • Date
    • Thread