2011-05-23 10 views
7

podemos cambiar el texto que está en el UISwitch, es decir, en & Off. He probado el siguiente código pero su estrellarsepodemos cambiar el texto en el uiSwitch

crashlog:

Terminación de aplicación debido a excepción no detectada NSInvalidArgumentException, la razón: '- [UISwitch setLeftLabelText:]: Selector no reconocido enviado a la instancia 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;  

Respuesta

Cuestiones relacionadas