From 2e8fc2ba293ce357bf9513d92f4b527491c47db7 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald@gmail.com" Date: Tue, 24 Apr 2012 21:56:30 +0000 Subject: [PATCH] use fixed values for UISwitch size, avoids crash on some device/iOS combinations --- PrefsBundle/BluetoothTableViewAdapter.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PrefsBundle/BluetoothTableViewAdapter.m b/PrefsBundle/BluetoothTableViewAdapter.m index 0e7707683..9621bb3cc 100644 --- a/PrefsBundle/BluetoothTableViewAdapter.m +++ b/PrefsBundle/BluetoothTableViewAdapter.m @@ -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