Re: Objects cross calls
Re: Objects cross calls
- Subject: Re: Objects cross calls
- From: Mont Rothstein <email@hidden>
- Date: Tue, 24 Jan 2006 07:17:07 -0800
I'll throw a couple of other things out that might help.
First (and someone else already said this) you might want to use
notifications. Any container (basket or fruit) that retains a fruit would
register for a notification of when it was being dealloc'd.
Second, you might consider making the child pointers from fruit to fruit be
weak references (no retain). Depending on the circumstances under which
your objects are created and destroyed this might work (i.e. if the parent
fruit always goes before the child, and if the child is always pointed to by
at least one other object).
-Mont
On 1/24/06, Hamish Allan <email@hidden> wrote:
>
>
> On Mon, 23 Jan 2006 19:17:25 +0100, Lorenzo wrote:
>
> > My fruit is an object that can contain other fruits in an array
> > called children, like a hierarchical table.
>
> Does your fruit "contain" other fruit, in the same way as a basket
> contains fruit? If not, you may be trying to model a "has-a"
> relationship and an "is-a" relationship using the same objects, which
> could be the cause of confusion.
>
> Why are you keeping an array of fruits distinct from your basket?
>
> Best wishes,
> Hamish
>
> _______________________________________________
> 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
>
_______________________________________________
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