更改UISwitch上的text

为要更改Text的UISwitch建立IB连接:例如mySwitch,在代码中改变文字:

((UILabel *)[[[[[[self.mySwitch subviews] lastObject] subviews] objectAtIndex:2] subviews] objectAtIndex:0]).text = @"Foo";

((UILabel *)[[[[[[self.mySwitch subviews] lastObject] subviews] objectAtIndex:2] subviews] objectAtIndex:1]).text = @"Bar";

 


posted @ 2010-11-29 18:59  Elf Sundae  阅读(1175)  评论(6编辑  收藏  举报