我在从BOOL设置UISwitch的状态时遇到问题。这可能很简单,所以如果有人能提供帮助,我会非常感激。这是我的代码不起作用,但可能会更清楚。
RoutingController *routingController = [[RoutingController alloc] initWithNibName:@"RoutingController" bundle:nil];
routingController.routingDelegate = self;
if (audioController->oscOneLFObool == YES) {
routingController.oscOneLFOOneSwitch.on = YES;
} else {
routingController.oscOneLFOOneSwitch.on = NO;
}
routingController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:routingController animated:YES];
答案 0 :(得分:1)
RoutingController的视图未加载,因此oscOneLFOOneSwitch为零。
在[self presentModalViewController:routingController animated:YES]
中查看加载