Re: Properties being set to nil?


Hi Sandor,

Yes, LTWGameViewController is a subclass of NSViewController and I set the Class in the Storyboard.

When I set a breakpoint in the Set Delegate method it shows the property set ok. Later on it responds to an IBAction and its set to nil. It certainly looks like there are 2 objects! Is this a bug? Is there a work-around?

Thanks a lot for your help.

On 16 Jan 2020, at 18:36, Sandor Szatmari <> wrote:

I’ve seen this happen if the view controller is instantiated in code and in the NIB (not sure about storyboards)

It gets hooked up correctly one time and things are nil in the other case. Are you subclassing NSViewController and setting it to the class of a view controller in your storyboard? If so, and your also instantiating the view controller in code you’ll see two initializations of the object. One will be good and the other may or may not.


On Jan 16, 2020, at 12:20, Dave <dave@...> wrote:

Join to automatically receive all group messages.