Abwesenheitsnachricht: Re: Accessing a property of a view via its controller doesn't work

2021-09-13 Thread Herman Keuchel (CGS) via Cocoa-dev
Thank you for your e-mail.   I will be back in the office on Monday, 13.09.2021.   Your e-mail will not be forwarded. For urgent matters please contact our general office, telephone +49 6182 9626-0 or i...@cgs-oris.com.   Kind regards,   Herman Keuchel   Head of R --  CGS Publishing Technologies

Re: Accessing a property of a view via its controller doesn't work

2021-09-07 Thread Gabriel Zachmann via Cocoa-dev
> > I asked earlier, but I’ll ask again: why are you doing this? NSView already > has a `window` property that provides its window. I agree, I guess, I should just remove this ivar. smime.p7s Description: S/MIME cryptographic signature ___

Re: Accessing a property of a view via its controller doesn't work

2021-09-07 Thread Ben Kennedy via Cocoa-dev
> On Sep 6, 2021, at 2:14 PM, Gabriel Zachmann via Cocoa-dev > wrote: > > I had assigned the window to an ivar window_ in viewWillMoveToWindow: > > - (void) viewWillMoveToWindow: (NSWindow *) newWindow > { >window_ = newWindow; I asked earlier, but I’ll ask again: why are you doing this?

Re: Accessing a property of a view via its controller doesn't work

2021-09-06 Thread Gabriel Zachmann via Cocoa-dev
> > Forgot an @synthesize? We haven’t needed to do that since Xcode 4.2. > > Do you know why you needed to do that? It seems pretty much like an edge > case. > Good question. I had assigned the window to an ivar window_ in viewWillMoveToWindow: - (void) viewWillMoveToWindow:

Re: Accessing a property of a view via its controller doesn't work

2021-09-06 Thread Alex Zavatone via Cocoa-dev
> On Sep 6, 2021, at 4:03 PM, Gabriel Zachmann via Cocoa-dev > wrote: > > Mystery solved - it was, of course, a stupid bug on my part. > > Just in case somebody else stumbles across this thread: I had forgotten a > @synthesize in the .m file. > (Xcode emits a warning about this, but I had

Re: Accessing a property of a view via its controller doesn't work

2021-09-06 Thread Gabriel Zachmann via Cocoa-dev
Mystery solved - it was, of course, a stupid bug on my part. Just in case somebody else stumbles across this thread: I had forgotten a @synthesize in the .m file. (Xcode emits a warning about this, but I had overlooked it, due to several other warnings always being there.) Sorry for bothering

Re: Accessing a property of a view via its controller doesn't work

2021-09-04 Thread Keary Suska via Cocoa-dev
Perhaps a more germane question might be, are you sure that the view controller has a relationship with any window? It is not necessary, as I understand, for a view to exist in a window. A view controller can load a view without placing it into a window, and therefore viewWillMoveToWindow: will

Re: Accessing a property of a view via its controller doesn't work

2021-09-04 Thread Greg Weston via Cocoa-dev
> I access the window of a view by two different ways, in the controller and in > the view, resp., and in the controller, I always get a nil pointer. Have you verified that the view you’re accessing in the controller is the same instance as the one that works?

Re: Accessing a property of a view via its controller doesn't work

2021-09-04 Thread Ben Kennedy via Cocoa-dev
> On Sep 4, 2021, at 10:27 AM, Gabriel Zachmann via Cocoa-dev > wrote: > > I access the window of a view by two different ways, in the controller and > in the view, resp., and in the controller, I always get a nil pointer. > > In my app, I have a subclass of NSView, MyView, declared like

Re: Accessing a property of a view via its controller doesn't work

2021-09-04 Thread Alex Zavatone via Cocoa-dev
I don’t know why this is happening, but I’ll often populate a variable if I know it from another class and can’t find it from another. By that, I mean if you know the window in the class that opens the preferences, get it and set it in the MasterViewController. > On Sep 4, 2021, at 12:26

Accessing a property of a view via its controller doesn't work

2021-09-04 Thread Gabriel Zachmann via Cocoa-dev
I access the window of a view by two different ways, in the controller and in the view, resp., and in the controller, I always get a nil pointer. In my app, I have a subclass of NSView, MyView, declared like this: @interface MyView : NSView { NSWindow * window_; ... } @property