• 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
Document-based app: UI item validation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Document-based app: UI item validation


  • Subject: Document-based app: UI item validation
  • From: Luc Van Bogaert <email@hidden>
  • Date: Sun, 21 Aug 2011 14:02:52 +0200

Hi,

I have a question regarding UI item validation in a document-based app. This is my current design:

A separate nib for the main menu, and a separate nib for the windowcontrollers to be instantiated from my document objects using makeWindowControllers.

For some of the menu items, I would like to use the target-action mechanism, and I would like to implement the action methods in my windowcontroller class.

My question is, in the MainMenu.xib file, what would be the preferred way to link the menu items to their target object?

I have tried setting my windowcontroller class as File's Owner in the mainmenu nib; but that didn't work, as the (first) windowcontroller object is only initialized *after* the menu is instantiated, resulting in "could not link target.." error message on startup.

Adding a windowcontroller to the mainmenu nib also doesn't work, as the windowcontrollers should be instantiated from my document objects. right?

So, that leaves me the option to use the First Responder object. This does work, but I'm still wondering if maybe there is a better approach.

Thanks,

--
Luc Van Bogaert

_______________________________________________

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: Document-based app: UI item validation
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: Very different Document Saving in Lion, even without enabling asynchronous
  • Next by Date: Can Peer-to-Peer Model Be Launched in AppStore?
  • Previous by thread: Re: Attributes to Cocoa properties?
  • Next by thread: Re: Document-based app: UI item validation
  • Index(es):
    • Date
    • Thread