multiple instances of a short when switching between uiviewcontrollers
I have two UIViewcontrollers (A and B) and within UIViewController A i have two "short" variables called C and D, and a method called E.
In the method E it uses D as a counter and loops round until it is the number 3 at which point it loads an image. clicking on the image loads UIViewController B.
When UIViewController B switches back to UIViewController A there are two instances of the shorts, one with the values set in viewDidAppear of UIViewController A (which I want) and one instance holding the values from the first time UIViewController A is used.
I have cheked this by simply putting in an NSLog to show the current value of C and D, the second time UIViewController A is dislayed I get two NSlog messages for each short.
Note: I am switching viewcontrollers by using PresentModalViewController.
Any ideas?
|