Re: Instantiating NSCells in Interface Builder
Re: Instantiating NSCells in Interface Builder
- Subject: Re: Instantiating NSCells in Interface Builder
- From: Daniel Zitter <email@hidden>
- Date: Wed, 4 Jun 2003 12:06:48 -0700
Jeff Harrell wrote:
Was I completely off-base in my initial inclination? Does it make any
sense to think about instantiating non-UI objects in Interface Builder
and wiring them up to IBOutlets in my controller(s)? If so, is it
possible to instantiate *any* class in IB, or just the ones in the
default list?
I think it is natural to see the split between what goes in the NIB and
what goes in the project and to desire a way to unify them as much as
possible into a single format. But IB is not what you would call a
general-purpose object development environment, so no, in general, you
cannot instantiate any object you want in IB. (At a minimum, an object
must conform to NSCoding protocol, which NSLock, to take an example
from your question, does not.)
IB is quite extensible through palettes so you may add any "palettized"
object (or set of objects) to a nib, but that means you have to build
this behavior into a palette. This extra work can justified if the
component gets used more than once, is the desired product i.e.
object-ware, and/or you are enabling another person who needs the
relative ease-of-use of IB, such as when SJ wants it for his keynote
demo. Otherwise it is often most expedient to do the basic UI in IB and
the rest in code.
I can think of one other option. Some of the 3rd party scripting tools
(Joy, F-Script, etc) allow one to instantiate any object within a
script. In this case, the the script is archived in the nib, not the
objects themselves. These technologies also permit some amount of
wiring to those objects, though IMHO, as cool as this may seem, the
current state of things just leaves me wanting a much tighter
integration with IB which does not seem likely.
Anyway, that's my take.
Cheers,
Dan
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.