Accessing NSWIndowController attribute from a subview in IB
Accessing NSWIndowController attribute from a subview in IB
- Subject: Accessing NSWIndowController attribute from a subview in IB
- From: Ben Golding <email@hidden>
- Date: Thu, 28 Apr 2011 21:28:06 +1000
I feel like I should be able to figure this out but I feel like I'm going around circles. I've looked through the mailing list and can't find anything similar (but I might be searching using the wrong terms).
I have a document-based app which loads a couple of NSWindowController subclasses. That's fine. In one of the subclasses, I load a nib with a NSView subclass. It wants to access one of the instance vars in the window controller subclass. I thought "no worries, I should be able to hook up a connection in IB and it will be right".
In my NSWindowController subclass (called "Face"), I have a method:
- (id)initWithSundial:(Sundial *)sundial
{
if ((self = [super initWithWindowNibName:@"Face"]) == nil)
return nil;
[self setSundial:sundial];
return self;
}
In the window that's loaded from Face.xib, there's a custom view (SundialView) which needs to access the sundial instance variable in File's Owner. I just don't seem to be able to control-drag in some order to hook them up and I think I should be able to.
Am I doing this the wrong way or do I have some sort of misunderstanding about how this works?
Ben.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden