title: Changing of UISwitch text in iOS 4.2
body: <p>I am trying to change the text in UISwitch.  The sample from the website ( <a href="https://stackoverflow.com/questions/2711180/changing-the-text-on-a-uiswitch">Changing the text on a UISwitch</a> ) 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.</p>
  
  <p>eg.</p>
  
  <pre><code>((UILabel *)[[[[[[_agreeAgb subviews] lastObject] subviews] objectAtIndex:2] subviews] objectAtIndex:0]).text = @"Foo";
  ((UILabel *)[[[[[[_agreeAgb subviews] lastObject] subviews] objectAtIndex:2] subviews] objectAtIndex:1]).text = @"Bar";
  </code></pre>
  
  <p>The exception thrown is because null object is encountered.</p>
  
  <p>Thanks.</p>