title: How to set image to the UISegmentedControl in iPhone?
body: <p>I am new to iPhone development. I have created UISegmentedControl having 2 segments. I want to display images for each segment instead of title. Here is my code </p>
  
  <pre><code>NSArray *itemArray = [NSArray arrayWithObjects: @"segment1", @"segment2", nil];
  UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:itemArray];
  segmentedControl.frame = CGRectMake(5,100,300,40);
  segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
  segmentedControl.selectedSegmentIndex = 1;
  [self.view addSubview:segmentedControl];
  [segmentedControl release]; 
  </code></pre>
  
  <p>But instead of displaying the title ,segment1 and segment2 it should be replaced with the images I have.</p>