UITableViewCell and UISwitches - iPhone SDK
问题 I am trying to save the states of an UISwitch for each cell in my UITableView. Is there a way to do this? I was thinking of using the NSUserDefault but I'm not too sure about saving the values with a given name and then retrieving that state when the cells are created. Any suggestions would be nice! Thanks, Kevin 回答1: you can try with following sample code; NSMutableDictionary *dictionay = [[NSMutableDictionary alloc] init]; [dictionay setObject:@"1" forKey:@"firstcell"]; [dictionay setObject