Global declaration?
Global declaration?
- Subject: Global declaration?
- From: Olivier Lachaume <email@hidden>
- Date: Fri, 8 Nov 2002 09:17:42 +0100
I have a question that has probably been answered many times, but I
cannot seem to find the answer in the archives (I'm probably not
looking for the right thing), so here we go:
My cocoa app creates objects that are stored in a NSOutlineView inside
a NSDrawer (and archived in a file for safekeeping). Their different
properties are set through eight NSTextFields and eight associated
NSSteppers.
I've just started implementing drag and drop in the application. I have
subclassed NSWindow so that I can drop objects on it from the drawer.
Then, I want the textfields and the steppers to reflect the values of
the object dropped on the window.
In order to do that, I would want to change those textfields and
steppers values from my window class performDragOperation method. The
only way I found is to pass the class in another method a reference to
an NSMutableArray from the controller class where the fields and
steppers are declared as outlets. (I guess I could also use contentView
to get the list of window components, but I'd have to go through at
least one NSBox first, and that seems even uglier than my current
solution).
My question is the following, is there a simpler way of doing this?
Could I define those textfields and steppers in such a way that any
class (or at least my window class) of my project can call them
directly? Is it possible to define them in the main class (I think I
read it was better to leave it alone) or something?
Thanks,
Olivier
_______________________________________________
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.