[Solved] Re: Accessing NSWIndowController attribute from a subview in IB
[Solved] Re: Accessing NSWIndowController attribute from a subview in IB
- Subject: [Solved] Re: Accessing NSWIndowController attribute from a subview in IB
- From: Ben Golding <email@hidden>
- Date: Fri, 29 Apr 2011 09:31:14 +1000
On 29/04/2011, at 00:17, Alexander Spohr wrote:
>> 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".
>
>> [...]
>>
>> Am I doing this the wrong way or do I have some sort of misunderstanding about how this works?
>
> Either or both.
>
> The view itself should not know anything about its controller or the controllers ivars. Wrong direction.
> You should make your WindowController set SundialView's sundial when it has been loaded. Problem solved.
Yes, you're right. I wanted to try to make IB do everything but it can't. I (independently) did exactly as you suggested and it works fine. Thanks.
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