• 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: Creating, Constructing and Managing Dynamic (Sub)Views
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating, Constructing and Managing Dynamic (Sub)Views


  • Subject: Re: Creating, Constructing and Managing Dynamic (Sub)Views
  • From: Graham Cox <email@hidden>
  • Date: Thu, 28 May 2009 16:33:52 +1000


On 28/05/2009, at 2:34 PM, Grant Erickson wrote:

is it best to have a NIB for each subview or pack them all into
a single NIB?


I'd say put all the subviews into the same nib. It makes it much easier to select among them because you can have a single master controller that has outlets for each subcontroller. You can also instantiate each subcontroller in the nib and connect up all the individual controls for each subview.

Switching them in and out could be done with a tabless tabview, but it's also very easy to write code that inserts and removes the subviews. This code can be made generic and not requiring modification if you add further types of subview by choosing a naming convention for your outlets and taking advantage of valueForKey:'s ability to discover ivars by name.

KVO and bindings can further reduce the code needed to implement the view/controller handling. With care it can be boiled down to just a few lines of code.

--Graham




_______________________________________________

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: 
 >Creating, Constructing and Managing Dynamic (Sub)Views (From: Grant Erickson <email@hidden>)

  • Prev by Date: Programmatically displaying NSStatusItem's menu
  • Next by Date: Booleans
  • Previous by thread: Creating, Constructing and Managing Dynamic (Sub)Views
  • Next by thread: Programmatically displaying NSStatusItem's menu
  • Index(es):
    • Date
    • Thread