Created
October 17, 2012 09:22
-
-
Save zeedark/3904649 to your computer and use it in GitHub Desktop.
UISwitch on an Accessory View of a UITableCellViewController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UISwitch * uis = [[[UISwitch alloc] init] autorelease]; | |
[uis addTarget:self action:@selector(toogleSwitch:) forControlEvents:UIControlEventValueChanged]; | |
NSString * key = [[sets objectAtIndex:[indexPath section]] objectForKey:SOME_KEY]; | |
uis.on = [[[NSUserDefaults standardUserDefaults] valueForKey:key] boolValue]; | |
uis.tag = [indexPath section]; | |
cell.accessoryView = uis; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment