• 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: Programmatic View Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programmatic View Question


  • Subject: Re: Programmatic View Question
  • From: Richard Somers <email@hidden>
  • Date: Sat, 18 Sep 2010 10:29:55 -0600

On Sep 18, 2010, at 9:36 AM, Raleigh Ledet wrote:

Define "lots". 10 or 100? Generally, you create a nib for each view and you programmatically load the nib with a view controller.

Lots means 20 initially, up to 80 total later on.

If variations are minor, then you can reduce the number of nibs to just the major layout differences and in your custom viewController class programmatically hide/show/modify just the minor differences. In general, I find doing most of the work in IB and making minor adjustments programmatically is a lot easier than doing everything programatically.

Very interesting concept, thanks for sharing this. So my application has 20 to 80 what I will call "view representations". Many of the variations are minor from one representation to another. Some are, well, not so minor. One reason for my having each view representation as a separate object is that state is easily maintained. Each view representation is put into a certain state by the user. When the user leaves a particular view representation and then returns the state must be restored. This is readily accomplished by having each view representation as a stand alone view object. I think this might be more difficult it there was only a single view object for all representations.


You can even use this tip recursively if that helps. That is, load a custom view that contains another custom view that you must load from another nib.

Yes I can see this. This is perhaps what Apple is doing with their stack views in the Inspector pane in Interface Builder. One view, loads another view, which loads another view, and so on.


Thanks for your comments.

--Richard

_______________________________________________

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: Programmatic View Question
      • From: Raleigh Ledet <email@hidden>
References: 
 >Programmatic View Question (From: Richard Somers <email@hidden>)
 >Re: Programmatic View Question (From: Raleigh Ledet <email@hidden>)

  • Prev by Date: Re: Programmatic View Question
  • Next by Date: Re: Drawing a custom NSTabView Border
  • Previous by thread: Re: Programmatic View Question
  • Next by thread: Re: Programmatic View Question
  • Index(es):
    • Date
    • Thread