• 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
Re: Could not connect the action to target of class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Could not connect the action to target of class


  • Subject: Re: Could not connect the action to target of class
  • From: Sherm Pendley <email@hidden>
  • Date: Fri, 11 Mar 2005 17:13:04 -0500

On Mar 11, 2005, at 3:38 PM, Hamish Allan wrote:

Thank you, but I'm still somewhat confused as to what I should be doing. I've changed back the custom class of my File's Owner to my Document class, added a new IBOutlet myWindowController to that class, instantiated my Controller object in IB, and connected the instantiated Controller to the File's Owner's (i.e., my Document class's) myWindowController variable. However, when it comes to time to makeWindowControllers (i.e., when I try to open a document) the variable myWindowController is still (null).

Unless you have a specific reason for needing a separate controller, don't create one. Just delete it, delete the myController outlet, and put your action methods in your document class.


If you're working with a complex app that needs multiple window controllers, or a subclass of NSWindowController, override -makeWindowControllers in your document class and create the controllers there.

If you need to initialize GUI elements or other outlets you've connected in IB, you can't do that in -makeWindowControllers; the Nib hasn't yet been loaded at that point. Instead, do that in your document class' -windowControllerDidLoadNib: method.

sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Could not connect the action to target of class
      • From: Hamish Allan <email@hidden>
References: 
 >Re: Could not connect the action to target of class (From: James McConnell <email@hidden>)
 >Re: Could not connect the action to target of class (From: Sherm Pendley <email@hidden>)
 >Re: Could not connect the action to target of class (From: Hamish Allan <email@hidden>)

  • Prev by Date: Re: memory problem with bi-directional referenced objects
  • Next by Date: Re: Is Mac Mini capable to develop cocoa app?
  • Previous by thread: Re: Could not connect the action to target of class
  • Next by thread: Re: Could not connect the action to target of class
  • Index(es):
    • Date
    • Thread