Re: NIB Files + Views. Is it a good practice?
Re: NIB Files + Views. Is it a good practice?
- Subject: Re: NIB Files + Views. Is it a good practice?
- From: Wain <email@hidden>
- Date: Sat, 21 Oct 2006 18:17:31 +0100
Hi,
It sounds like you haven't noticed the 'Custom View' item on the
'Cocoa-Containers' palette, it's a basic NSView instance.
Wain
On 21 Oct 2006, at 17:47, Fabio Mancinelli wrote:
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