NSArrayController help
NSArrayController help
- Subject: NSArrayController help
- From: Mike Nowak <email@hidden>
- Date: Fri, 31 Oct 2003 15:06:04 -0500
I am exploring using NSArrayController to help me manage a table in my
interface. I have an object that represents annual data. My table
displays the year as the first item in the table. When a person adds a
new item to my array, I wanted to find the maximum year that exists and
prefill in that year + 1 by initializing the year instance variable for
that object.
I am finding it tricky to find a hook to do this. I thought I could an
add an observer to the mutable array but I'm not sure how to do that or
how to get to the mutable array the NSArrayController is managing
anyway. It would be nice if there was some kind of delegate method in
NSArrayController that would let me know when its about to add an item,
or about to remove an item, and so on. But I didn't see any delegate
methods.
I guess I can subclass NSArrayController and so I can override
addObject and set the year for the new item. Is the best way to do it?
Thanks!
--
Mike Nowak
Work:
http://healthmedia.umich.edu/
Personal:
http://snackdog.org/
"Everybody fights. Nobody quits. Otherwise I'll shoot you myself." -
Starship Troopers
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.