Newbie Connections Question - Sorry!
Newbie Connections Question - Sorry!
- Subject: Newbie Connections Question - Sorry!
- From: Nate Murray <email@hidden>
- Date: Mon, 13 Sep 2004 18:10:03 -0700
Summary: How can my object instances access my IB Outlets??
The Long Question:
okay im having a problem connecting my two classes.
I have three classes (among other things)
AdamView (my subclass of NSView)
AdamController
AdamSprite
I have all the connections in interface builder set up correctly. The IB outlets are in my header files. AdamView, and AdamController can talk to each other and AdamSprite.
AdamSprite can even see the AdamView and AdamController
sometimes.
For instance, when I debug and put a break in AdamSprite->awakeFromNib
- (void)awakeFromNib
{
NSLog(@"[AdamSpritesController awakeFromNib]");
break-> [adamView anything];
}
under Arguments->self->adamView i get a perfectly good connection "value" (0x53bf50)
The problem lies when I try to access adamView (or any other IBOutlet) from the object that is created by something other than the nib.
Let me re-phrase that: I have more than one AdamSprite object. One for each sprite on the screen plus the one that the Nib file creates when the program starts.
The AdamSprite object that the Nib file creates seems to have access to all the IBOutlets but any other instances i create have a "adamView" value of 0x0. Shouldnt all my instances have access to all of the IB Outlets? If not, how to I give it to them?
I know this is a basic question but Ive spent a while looking it up in the documentation and various tutorial sites (orielly, cocoa dev central, etc). But I still cant figure it out!
Im assuming from what little I know of Objective-C that someone is going to tell me that I need to have a (Controller?) class as an intermediary between my instance objects and the class. Now if I could just figure out how to do this...
Any help would be appreciated and I could certainly post the project if anyone was that interested in helping.
Thanks,
-Nate _______________________________________________
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