Re: messaging between (un)related objects
Re: messaging between (un)related objects
- Subject: Re: messaging between (un)related objects
- From: Justin Spahr-Summers <email@hidden>
- Date: Tue, 8 Mar 2005 18:48:44 -0600
Yes, you are overthinking it. Just have Class B maintain a reference
to A, and create a method in A to handle this transfer. Notifications
in this instance have unneeded overhead.
On Tue, 8 Mar 2005 18:07:30 -0600, Sandeep Parikh
<email@hidden> wrote:
> here's the scenario, I've got 2 classes, A and B. class A contains an
> NSMutableArray of NSMutableDictionary objects.
>
> class A creates an instance of class B (neither class maintains any
> reference to each other). class B manipulates an NSMutableDictionary.
> class B then needs to send its dictionary to class A. what is the best
> way to accomplish this?
>
> here are my thoughts:
> - class B could send the object through the use of a notification
> - class A could be set as a delegate of class B and therefore be
> notified when the object needed to be sent
> - class B could maintain a reference to A and just pass the object
> through one of A's methods
>
> I don't want to re-invent the wheel here and I've been racking my brain
> trying to find a standard way to do this within the normal Cocoa
> paradigms. I feel like this is so simple and I'm just overthinking it.
>
> Any help here would be greatly appreciated.
>
> Thanks!
> -Sandeep
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden