Re: Interface Builder question
Re: Interface Builder question
- Subject: Re: Interface Builder question
- From: Shawn Erickson <email@hidden>
- Date: Mon, 29 Jul 2002 18:25:25 -0700
On Monday, July 29, 2002, at 06:01 PM, Terry Simons wrote:
Hi,
Is it possible to create connections between objects without Interface
Builder, or is Interface Builder *required* for doing this sort of
thing?
No, IB is not required... its just like get pointers to C structs,
pointers to objects in C++, or reference in Java...
IB uses outlets which are simply pointers to other classes defined in
your class. The connections are setup for you, in this case, by the nib
loading process. Basically in IB you are creating instances of your
class that are then archived, connections and all, into your nib. When
unarchived (you get your awakeFromNib call) all of the outlets for that
instance are setup.
Anyway... to build connections between objects at run time you need to
get a pointer to the object you need and optionally store it in an
instance variable for your class, etc. (retaining/releasing it as
needed). How to go about this greatly depends on what you are trying to
do...
If one object creates another then you have your pointer already and
simply need to use it or remember it (be sure to release it when done).
If you need to get an object that you do not create you need to ask
some other instance or class for a pointer to the object (retain it if
you need to keep it around but make sure to release it when done).
So what are you trying to do?
-Shawn
_______________________________________________
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.