Re: Asyncronous message handling
Re: Asyncronous message handling
- Subject: Re: Asyncronous message handling
- From: Keary Suska <email@hidden>
- Date: Tue, 6 Jan 2009 21:12:17 -0700
On Jan 6, 2009, at 11:14 AM, Mohan Parthasarathy wrote:
Let us say that there are two objects A and B.
1) Object A produces some data
2) Object B consumes the data produced by object A
When object B sends a message to object A for fetching the data, the
data is
not available immediately. When the data arrives later, it needs to
notify
object B.
For example, object A fetches data from some web service and Object
B is
some sort of a "controller". How does one handle this in Cocoa ?
- I can include the functionality of Object A within Object B itself
and
hence there is no issue. But i guess this is prohibited as per the MVC
design.
- Object A can retain object B and later send the message back when
data is
available. But then this creates a dependency of object B knowing
object A
and object A knowing object B. Is this okay ?
- Any other way ?
NSNotificationCenter? Object Delegation Pattern <http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/chapter_6_section_4.html#//apple_ref/doc/uid/TP40002974-CH7-SW26
> ? Key-Value Observation?
HTH,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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