I am trying to change the text in UISwitch. The sample from the website ( Changing the text on a UISwitch ) works fine but when I upgrade my xcode to 3.2.5 and iOS 4.2, the application crash when the functions is being called to change the text. I am using the following example from the website.
eg.
((UILabel *)[[[[[[_agreeAgb subviews] lastObject] subviews] objectAtIndex:2] subviews] objectAtIndex:0]).text = @"Foo";
((UILabel *)[[[[[[_agreeAgb subviews] lastObject] subviews] objectAtIndex:2] subviews] objectAtIndex:1]).text = @"Bar";
The exception thrown is because null object is encountered.
Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…