Quote:
Originally Posted by alain55
I use global var to pass data between two views but this seems not to work between two non-adjacent views. Let me explain.
1. I write the glob var in view 1.
2. I push down in view 2, I can read the global var ok.
3. I push down in view 3, the global var are not there anymore.
I have also tried to copy the glob vars in view 2 to new ones, and these are
not readable in view 3
Any ideas why this behavior? and are glob var really global throughout the whole app or just on one view controller.
|
Have you included the header for view 1 in view 4?
I have seen on occasions global variable losing scope, but it's normally due to the fact that I haven't reference them correctly.
Globals can be dangerous in this respect.
Hope this helps.