I have a UISegmentedControl in one of my ViewControllers.This VC has a 'close' button,so the user makes a selection using the segmentedcontrol and then closes the window by clicking on the 'close' button.I want to use the value selected by the user in another VC.But the selection of the segmentedcontrol is not persisted. If I close the window and open it,the segmented control switches back to its original state. I have not set the segmented control to be 'Momentary'. Any idea why the state isn't persisted? And how do I access the selected index in another view controller?
Asked
Active
Viewed 168 times
1 Answers
1
The state isn't persistent because when you close the window that view controller is probably deallocated, and you create a new instance when you open it again (although this is just a guess since you haven't posted any code).
How you get that value depends on how your app is set up. You could use a notification or a delegate method. If you need more specifics, then you need to provide more information about how your app is structured.

rdelmar
- 103,982
- 12
- 207
- 218
-
thanks for the "notification" and "delegate" hint! i will implement one of these – user1550951 Nov 09 '12 at 05:22