Possible Duplicate:
can anyone tell me how to use switch ?
Hi I have two view
the first view contains the main function and the second view is used to let the user change the setting on the first view.
I have insert a switch in second view to let user change a setting on the first view
I have two questions, how to use switch to set YES and NO for a value? and then, base on that value the first view will respond differently?
P.S. I change the view with navigation method , not add subview
Thanks in advance
lets say I have the following code
First View.m
- (IBAction) addValue:(id)sender
{
aValue ++;
}
//the following will react according to the setting on second view
If (????//Don't know what to put here to represent the switch is ON or OFF)
{ //whatever action}
else
{//whatever action}
second view.h
@interface
//declaration of the switch
- (IBAction) changeMode:(id)sender
@end
second view.m
-(IBAction) changeMode:(id)sender
{
//What to put here to switch ON and OFF ??
}