Saturday, 24 August 2013

Can't access instance variables with menus in MainMenu.xib

Can't access instance variables with menus in MainMenu.xib

For some reason I keep getting null values when using menu items in the
MainMenu.xib. I think I understand First Responder and the responder chain
(maybe), and my menus are firing the methods I want them to fire in
various controllers. Unfortunately, the instance variables in the
controllers always are null when called from a menu. But when the same
method is called by a button, the values of the instance variables are as
expected. I have made sure that the controllers and their instance
variables are alloc/inited before using the menu, and they are. I can fire
a method with a button and watch it work, and then in the same runtime
fire it with a menu and watch it come up null. Obviously I am missing
something major about menus.

No comments:

Post a Comment