• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
I can't supply document reference to (init) with bindings, can I?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I can't supply document reference to (init) with bindings, can I?


  • Subject: I can't supply document reference to (init) with bindings, can I?
  • From: David Hirsch <email@hidden>
  • Date: Sun, 29 Nov 2009 15:31:15 -0800

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: email@hidden
http://www.davehirsch.com
voice: (360) 389-3583
aim: email@hidden
vCard: http://almandine.geol.wwu.edu/~dave/personal/DaveHirsch.vcf
============================



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: I can't supply document reference to (init) with bindings, can I?
      • From: Graham Cox <email@hidden>
    • Re: I can't supply document reference to (init) with bindings, can I?
      • From: Dave Carrigan <email@hidden>
  • Prev by Date: Re: Appropriate Use of NSFormatter?
  • Next by Date: Re: I can't supply document reference to (init) with bindings, can I?
  • Previous by thread: Re: Appropriate Use of NSFormatter?
  • Next by thread: Re: I can't supply document reference to (init) with bindings, can I?
  • Index(es):
    • Date
    • Thread