Re: initiate content of NSArray
Re: initiate content of NSArray
- Subject: Re: initiate content of NSArray
- From: Art Isbell <email@hidden>
- Date: Tue, 22 Jun 2004 17:29:04 -1000
On Jun 22, 2004, at 3:48 PM, Goh Keng Boon wrote:
Hi can you explain in detail how to do that?
I've already fetch all content into an NSArray and bind this array to
List of WORepetition, i need to set value for one of the attribute
inside that NSArray(for every record),
so i'm not sure how to set that? Am i going to loop through the
NSArray to set them record by record?
On 22-Jun-04, at 11:52 PM, wojingo wrote:
I think you could use awakeFromFetch(called for you when fetched from
DB:)
If you're always going to set the value of one or more attributes of
each object fetched, as wojingo suggested, implement awakeFromFetch()
in the EO class to set the value of one or more attributes. This will
occur automatically as each object is fetched. Don't forget to send
super an awakeFromFetch() message.
If you won't always set attribute values as each object is fetched,
then you'll need to iterate through each object in the array.
WORepetition is already iterating through the array, so if you
implement anInvoiceItem()/setAnInvoiceItem(), you can set the values of
each attribute in setAnInvoiceItem() which WORepetition will invoke for
each object in the array.
So the approach you choose depends on what you need to do.
Aloha,
Art
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.