use fixed values for UISwitch size, avoids crash on some device/iOS combinations

This commit is contained in:
matthias.ringwald@gmail.com 2012-04-24 21:56:30 +00:00
parent 0aa9f039c7
commit 2e8fc2ba29

View File

@ -41,8 +41,7 @@
bluetoothActivity = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; bluetoothActivity = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[bluetoothActivity startAnimating]; [bluetoothActivity startAnimating];
_tableView = tableView; _tableView = tableView;
CGRect dummy; self.loggingSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(0,0, 100, 20)]; // size will be ignored anyway
self.loggingSwitch = [[UISwitch alloc] initWithFrame:dummy];
[loggingSwitch addTarget:self action:@selector(loggingSwitchToggled) forControlEvents:UIControlEventValueChanged]; [loggingSwitch addTarget:self action:@selector(loggingSwitchToggled) forControlEvents:UIControlEventValueChanged];
// get old value // get old value