KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a view in which its objects are set from a database and likewise saved to a database. The UITextViews are working great, but I cannot seem to find out how to set the state of a UISwitch. I can change it in the IB but that isnt what I need. The record in the DB has a 0 or 1 boolean. So if the field is true then I want to set the state of the UISwitch to ON. Also when I save the record, I need to be able to look at the value on the view, and thus set the field on my table. thanks for any help!! EDIT: This is what I have done so far: .h file @interface UserEdit : UIViewController { IBOutlet UISwitch *male; } @property (nonatomic, retain) IBOutlet UISwitch *male; .m file @synthesize male; - (void)viewDidLoad { [super viewDidLoad]; [male SetOn:NO]; } the app dumps when it hits the SetOn line above I also need to be able not only set the value, but read it too
Tags (comma-separated)
Save Edits
Cancel