• 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
NIB Files + Views. Is it a good practice?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NIB Files + Views. Is it a good practice?


  • Subject: NIB Files + Views. Is it a good practice?
  • From: Fabio Mancinelli <email@hidden>
  • Date: Sat, 21 Oct 2006 18:47:45 +0200

Hello all.

I was playing a bit with instantiating new views in a NIB file.
What I do is the following:

1) I create a subclass V of NSView
2) I instantiate V
3) I populate the instance with controls using the palette
4) I use the instance by referencing it in the AppController

However, I realized that I don't need any additional functionality for the View when doing what I have described. NSView would be fine. So having the subclass V is useless.

What I did was the following:

1) I create a subclass V of NSView
2) I instantiate V
3) I populate the instance with controls using the palette
4) I set back the custom class of the instance to NSView
5) I deleted V from the NIB classes
6) I use the instance of the view by referencing it in the AppController

Everything worked well so I suppose that this is a good way to do.
Moreover I have also seen some NIBs with instances of View components but no NSView subclasses inside them.


So the question is: is this a good practice? And if yes, why can't I instantiate directly a NSView instead of creating a subclass just for deleting it after the View instance creation?

Thank you,
Fabio



_______________________________________________
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: NIB Files + Views. Is it a good practice?
      • From: Wain <email@hidden>
  • Prev by Date: Re: Tokenfield blues (literally)
  • Next by Date: Re: encrypting a pdf
  • Previous by thread: Re: making small pdfs
  • Next by thread: Re: NIB Files + Views. Is it a good practice?
  • Index(es):
    • Date
    • Thread