Properties being set to nil?


Dave
 

Hi All,

I have a View Controller that is Instantiated in code from a storyboard file:

myGameViewController = [myStoryboard instantiateControllerWithIdentifier:kLTWGameMainViewControllerID];
if (myGameViewController == nil)
{
return;
}

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?

Dave

Join cocoa@apple-dev.groups.io to automatically receive all group messages.