I’m unable to refer to my integer pickedItem declared in my RootViewController.h in my DetailViewController.m file.
Not sure if I should declare this as a global variable, but tried unsuccessfully to do so.
I think this should be simple, but I haven’t got any other suggestions (from other posted answers) to work.
Thanks in advance.
You can access the app delegate through
this call. And then can access the root view controller’s property (assuming you have access to the rootViewController object in appDelagate).
In RootViewController.h
And from anywhere in the code
p.s. I have just typed the code, not compiled. So there might be some typo.