- Properties being set to nil?
Re: Properties being set to nil?
toggle quoted messageShow quoted text
If the address is different it is another instance.
On Jan 16, 2020, at 11:20 AM, Dave <dave@...
This is the only place the View Controller is instantiated. One thing I’ve notice is that if I set a breakpoint in ViewDidLoad and print self:
< LTWMacGameViewController: 0x600003500840>
and then again in setGameControlDelegate
The addresses are different, so it looks like the View Controller returned by instantiateControllerWithIdentifier is different to the one actually instantiated?
On 16 Jan 2020, at 18:00, Jon Gotow <gotow@...
Any chance you're reloading your view controller (when starting a new game or whatever) and not subsequently setting the delegates again?
On Jan 16, 2020, at 9:55 AM, Dave <dave@...> wrote:
I have a View Controller that is Instantiated in code from a storyboard file:
myGameViewController = [myStoryboard instantiateControllerWithIdentifier:kLTWGameMainViewControllerID];
if (myGameViewController == nil)
I then set some delegates:
[myGameViewController setGameControlDelegate:[self getGameControlDelegate]];
[myGameViewController setGameCommandDelegate:[self getGameCommandDelegate]];
These methods just store the delegate in Strong properties, I’ve checked and they are set ok.
However, I put a break point in viewDidLoad: and look at the properties again they have been set to nil!
I’ve checked and the properties in question are only set once in the appropriate setDelagateMethod.
Is there some magic going on? Is it legal to do this?
Thanks in advance for any help?
Join firstname.lastname@example.org to automatically receive all group messages.