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 startAnimating];
_tableView = tableView;
CGRect dummy;
self.loggingSwitch = [[UISwitch alloc] initWithFrame:dummy];
self.loggingSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(0,0, 100, 20)]; // size will be ignored anyway
[loggingSwitch addTarget:self action:@selector(loggingSwitchToggled) forControlEvents:UIControlEventValueChanged];
// get old value