• 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: Associating interface state with NIB content
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Associating interface state with NIB content


  • Subject: Re: Associating interface state with NIB content
  • From: Uli Kusterer <email@hidden>
  • Date: Thu, 21 Feb 2008 12:45:16 +0100

On 21.02.2008, at 01:32, Graham wrote:
Can anyone suggest an easier way? - I expect there's some obvious solution staring me in the face. Is there a place in a NIB-stored view that I can stash an identifier of some sort and then locate the view using this identifier when my app is launched?


I don't really see anything bad with having your controller perform this association.

If you want to keep more intelligence in data, you could use a .plist file that contains a dictionary with the mappings between the identifier and the outlet name, and have your controller load that. If that was an array of dictionaries, you could even attach other data for each pane there (e.g. name of image to use as toolbar icon, order to show them in in the "Window" menu, default visibility at startup etc.).

Alternately, you could create a custom view and an Xcode 3 Inspector framework/plugin to go with it. Then all your root views would be of MYCustomIdentifiedView and you'd have GUI to edit the identifier. Some views also have a tag, or a "representedObject" that might be suitable for this use. E.g. the various tabs in an NSTabView, so if you can use something like that as your root view, that may be an option.

Finally, you could hack it in an ugly way, i.e. require that every such view contains a hidden NSTextField as its first subview that contains the identifier (or any other NSControl -- an NSButton would probably have less overhead).

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de





_______________________________________________

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


References: 
 >Associating interface state with NIB content (From: Graham <email@hidden>)

  • Prev by Date: Re: DO in all run loop mode
  • Next by Date: NSWindow title bar icon without representedURL
  • Previous by thread: Associating interface state with NIB content
  • Next by thread: How to get my class instance that's in IB
  • Index(es):
    • Date
    • Thread