• 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 NSViews with code.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating NSViews with code.


  • Subject: Re: Creating NSViews with code.
  • From: Daniel Jalkut <email@hidden>
  • Date: Wed, 16 Feb 2005 20:47:44 -0800

I think it's a bad idea to (ab)use tab views like this. Whatever the number of configurations (N), you will have (N * N-1) wasted instances of tab view UI content views. I agree with the proposition that one should not worry about performance until it's measurable, but in this case it's really just as easy to have a blank slate into which you set a view loaded from a specific nib.

If the configurations truly are reorganizations of the same basic elements, you can set up the nib's owner such that it uses the same outlet ivars to point to the corresponding items from whatever NIB file it's loaded from.

Let's say you have a "MyViewController" class that loads one of several configurations. You could define separate init methods for each of the configurations: initWithConfiguration1, initWithConfiguration2, etc. The class code works the same no matter what the configuration, and the client is able to determine which interface is used based on the init routine.

Daniel

 you will have many (N-1) unused instantiations per view.

On Feb 16, 2005, at 3:34 PM, j o a r wrote:
On 2005-02-17, at 00.27, Jonathan E. Jackel wrote:
Having multiple nibs for each different setup and loading the
respective one
Bingo!
Or wrap all view configurations in a tab view, with a separate configuration per tab.
When the user wants to use a different configuration, you just switch to the corresponding tab.

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Creating NSViews with code.
      • From: j o a r <email@hidden>
References: 
 >RE: Creating NSViews with code. (From: "Jonathan E. Jackel" <email@hidden>)
 >Re: Creating NSViews with code. (From: j o a r <email@hidden>)

  • Prev by Date: Customizing Mail.app
  • Next by Date: Re: Customizing Mail.app
  • Previous by thread: Re: Creating NSViews with code.
  • Next by thread: Re: Creating NSViews with code.
  • Index(es):
    • Date
    • Thread