• 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
Connecting menu item to controller in different nib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Connecting menu item to controller in different nib


  • Subject: Connecting menu item to controller in different nib
  • From: Matthew Roberts <email@hidden>
  • Date: Wed, 24 Jul 2002 10:08:52 -0500

Still working on my first real Obj-C app (despite only knowing the bare
basics of the language). Right now I've got two real class files (and a nib
for each). One is main.m and the MainMenu.nib. The other is the nib for my
document window and its associated class.

The document class is acting as the controller and delegate for anything
that happens within the window (e.g. loading/saving its data, acting as
window controller, and controller/data source for a table view).

The main menubar is, of course, defined in the MainMenu nib. My problem is
that I want to connect one of that nib's menu items to an action on the
document's controller (which is the "File's Owner" object in the nib
window).

I can successfully trigger actions from buttons that belong to the document
nib. However, no matter what I do I just can't make the menu item
connection. I first of all learned that for the drag-connections to even
start to work right in this case, I had to have the MainMenu nib display in
outline format. I then make the document nib the foremost window. I
control-click from the menu item in the MainMenu hierarchy and drag to
"File's Owner" in the document nib window. The highlight lines/boxes
show-up correctly as if I should be able to make a connection. However,
when I release the mouse, the "target" option for the menu item contains
nothing--not actions to hook to.

I'm not sure what I'm doing wrong here. However, I'm also not certain that
I'm handling the whole object set-up correctly. Should I have created
separate controller classes? Is there something I'm overlooking here?

_________________________________
Matthew Roberts (email@hidden)
Ph.D. Candidate, Dept. of Political Science
Instructional Technology Fellow
University of Minnesota
http://www.polisci.umn.edu/graduate/students/mroberts
_______________________________________________
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.

  • Follow-Ups:
    • Re: Connecting menu item to controller in different nib
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: Retain/release objects in an array...
  • Next by Date: Re: Connecting menu item to controller in different nib
  • Previous by thread: Sherlock indexing of Frameworks
  • Next by thread: Re: Connecting menu item to controller in different nib
  • Index(es):
    • Date
    • Thread