My application tested whether my selectedViewController was equal to my moreNavigationController.
if( self.tabBarController.moreNavigationController == self.tabBarController.selectedViewController )
{
// do something awesome.
}
else
{
NSLog(@"No match");
}
The expression always evaluated false, so I started debugging. I put a breakpoint in the code and hovered my pointer over 'self', which caused the yellow cascading popup where I could see the addresses of both Controllers. The addresses were the same in the popup, which must be incorrect since the if statement failed. I see the same result in the debugger window.
I added these logging statements later, which revealed that the objects had 2 different addresses.
NSLog([NSString stringWithFormat:@"%d",(self.tabBarController.moreNavigationController)] );
NSLog([NSString stringWithFormat:@"%d",(self.tabBarController.selectedViewController)] );
Why did the debugger window lie? Specifically, does anyone know what value it displays as its address, and why the controllers would show the same address?