UISwitchにあるテキスト、つまりオンとオフを変更できますか?私は次のコードを試しましたが、クラッシュします
クラッシュログ:
キャッチされなかった例外NSInvalidArgumentExceptionが原因でアプリを終了しています、理由:'-[UISwitch setLeftLabelText:]:認識されないセレクターがインスタンス0x4c65020に送信されました' **
switcher = [[[UISwitch alloc] initWithFrame:CGRectZero] autorelease];
[switcher addTarget:self action:@selector(switchAction:)
forControlEvents:UIControlEventValueChanged];
// swit = [[UISwitch alloc] initWithFrame:CGRectZero];
[switcher setCenter:CGPointMake(160.0f,260.0f)];
[switcher setLeftLabelText: @"Female"];
[switcher setRightLabelText: @"Male"];
[[switcher rightLabel] setFont:[UIFont fontWithName:@"Georgia" size:16.0f]];
[[switcher leftLabel] setFont:[UIFont fontWithName:@"Georgia" size:16.0f]];
[[switcher leftLabel] setTextColor:[UIColor yellowColor]];
cell.accessoryView = switcher;
switcher.tag = indexPath.row;