¡@

Home 

2014/10/15 ¤U¤È 10:12:21

iphone Programming Glossary: onoff

Creating a UISwitch Programmatically

http://stackoverflow.com/questions/2025842/creating-a-uiswitch-programmatically

I setup the UISwitch @interface AddViewController DetailViewController id AddViewControllerDelegate delegate UISwitch onoff @property nonatomic assign id AddViewControllerDelegate delegate @property nonatomic retain IBOutlet UISwitch onoff I also.. onoff @property nonatomic assign id AddViewControllerDelegate delegate @property nonatomic retain IBOutlet UISwitch onoff I also setup an IBAction IBAction flip id sender Then I synthesize it in the AddViewController.m file but nothing happens... So I implemented the code as I was directed to in the viewDidLoad like so void viewDidLoad super viewDidLoad UISwitch onoff UISwitch alloc initWithFrame CGRectZero onoff addTarget self action @selector flip forControlEvents UIControlEventValueChanged..