Re: Instantiating NSCells in Interface Builder
Re: Instantiating NSCells in Interface Builder
- Subject: Re: Instantiating NSCells in Interface Builder
- From: Jeff Harrell <email@hidden>
- Date: Wed, 4 Jun 2003 10:48:49 -0500
I have kind of a similar question. Well, sort of similar. Vaguely
reminiscent, maybe.
A few weeks ago I was working on a pet project. My pet project had a UI
with two windows and two controller objects, one controller for the
application and one for an asynchronous task that ran in the
background. They shared some common data: an NSMutableArray, which was
acting as a queue, and an NSMutableDictionary, which stored some global
runtime parameters.
I got the bright idea of instantiating these objects in Interface
Builder and wiring them up to my controller objects. That way I would
have to write initialization code for them. They'd just appear
magically after the nib was loaded.
I gave up that idea when I found that NSLock wasn't one of the classes
available in Interface Builder. (I was using an NSLock to control
access to that NSMutableArray I mentioned.) I just made the array,
dictionary, and lock instance variables of my application controller
and wrote accessor methods for the other controller object to get at
them, which was a little bit of a pain in the neck.
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?
(Hmm. On second thought, this question might be better suited for
project-builder-users. Apologies all-around if I'm asking the wrong
list.)
On Wednesday, June 4, 2003, at 02:44 AM, Pete Yandell wrote:
I've a feeling that this is a really dumb question, but is there a way
to instantiate an NSButtonCell (or other arbitrary class for that
matter) in Interface Builder?
I thought it would just be a case of going to the Classes tab,
selecting NSButtonCell and choosing Instantiate from the Classes menu.
Unfortunately most of the available classes leave the Instantiate meny
greyed out. Why is that? Am I missing something obvious?
Pete Yandell
http://pete.yandell.com/
_______________________________________________
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.
_______________________________________________
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.