Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mcnuggets

macrumors newbie
Original poster
Jan 2, 2009
18
0
I have an app similar to the SQLiteBook example from Apple and I put a segmented controller with 3 values (ex: low, med, high). When I add an entry, the segmented controller is set to the value of low when the view is loaded. Lets say, I change the value to Med and save it. When I try to add another entry... the segmented controller is set to the last value... in this case... Med. My question is... how do I reset the segmented controller to Low everytime I add a new value? I've checked Apple's docs and can't find the answer.
 

mcnuggets

macrumors newbie
Original poster
Jan 2, 2009
18
0
When you add the new value, just do a:
Code:
segmentedControl.selectedSegmentIndex = 0;

Thanks I'm trying that but it still wont work. Maybe I'm adding it to the wrong section.

So basically here's the problem:
1) Launch the application
2) Click Add
3) Choose Status "Medium"
4) Click back to Todo Items.
5) Click Add
6) Now you notice that the Segment control is saved on "Medium". I want it to change to "Low" everytime this view gets called upon.

Here's the location of the zip file example that I'm playing with:
http://icodeblog.com/wp-content/uploads/2008/09/todo-part-4.zip

Please assist if you can... because I'm so frustrated right now. :(
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
Try adding the following line to the end of addTodo: in RootViewController.m:
Code:
self.todoView.todoPriority.selectedSegmentIndex = 0;
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.