Re: Walking an Object's Relationships
Re: Walking an Object's Relationships
- Subject: Re: Walking an Object's Relationships
- From: Florijan Stamenkovic <email@hidden>
- Date: Wed, 24 Aug 2005 12:57:15 +0200
Sorry, this was a bit sloppy... :
Simple example:
public int countOfSubtree(MyEO eo)
{
int count;
NSArray objects = eo.relationship();
count = objects.count(); //otherwise we always get 0 as the result
for(int i = 0 ; i < objects.count() ; i++)
count += countOfSubtree( (MyEO)objects.objectAtIndex(i) );
//recursion
return count;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden