I'm trying to use bindings as much as possible, but I think I need to do this with actions & outlets. I have a NSArrayController (courseController) managing an NSMutableArray (courses) of Course objects. In order to correctly initialize each Course, I need to have data from other arrays (like the rooms array) that my document knows about. In (init), I tried to use the sharedDocumentController to get the current document, but in reading online, that seems to be unwise (what if the window or application is not frontmost), and furthermore, it seems not to work: I cannot get a reference to the current document from the sharedDocumentController, for some reason.

So: is there some tricky way to have the "add new course" button tell the courseController to add a new Course, but somehow call a custom init (like init:withDocument:) and supply some reference to the current document? I doubt it, but it seems worth asking.

Thanks in advance.
-Dave

============================
Dave Hirsch
Associate Professor
Department of Geology
Western Washington University
persistent email: dhir...@mac.com
http://www.davehirsch.com
voice: (360) 389-3583
aim: dhir...@mac.com
vCard: http://almandine.geol.wwu.edu/~dave/personal/DaveHirsch.vcf
============================



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to