I'm trying to set the UISwitch selected value and it's not responding!
Here is my code
I set the value to UISwitch. Default value is False.
[mailSwitch setSelected:TRUE];
Can someone help me.
I'm trying to set the UISwitch selected value and it's not responding!
Here is my code
I set the value to UISwitch. Default value is False.
[mailSwitch setSelected:TRUE];
Can someone help me.
The property you’re looking for is on
; in method form, -setOn:
or -setOn:animated:
.
selected
is a generic property, declared on UIControl, which has no visible effect on a UISwitch.
setOn should work
When I developed an iPhone App, I had problems with checking the status of a checkbox, too. My workaround was to call a function everytime this checkbos is selected or deselected, and save the status then in another variable.