I'm having problems working with UISwitch on a static UITableView . I have to restore the last state of a specific UISwitch when the application loads, but whenever I check the status of IBOutlet , it is zero. I tried to manually assign a variable, which also did not help.
That's what I'm doing:
SettingsController.h
//IBOutlet connected correctly @property (strong, nonatomic) IBOutlet UISwitch *switch_displayDetail;
SettingsController.m
- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; if (!_switch_displayDetail) { NSLog(@"_switch_displayDetail is NIL");
In any case, when I check the status of _switch_displayDetail , it is zero. I call all methods of super initialization. Has anything changed on iOS 6.1?
[EDIT] Using a synthesized variable also does not work.
[EDIT 2] Found the problem to be a bug on Xcode or on iPhone Simulator. After testing on my iPod touch, the original algorithm worked fine.
I am getting away with this problem ...
source share