iPhone - adding a UISegmentedControl to a Navigation Controller Toolbar
<p>Is this an heresy to add a UISegmentedControl to a navigation Controller Toolbar?</p>

<p>I am considering this code:</p>

<pre><code>UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:
                                            [NSArray arrayWithObjects:
[NSString stringWithString:NSLocalizedString(@"One", @"")],
[NSString stringWithString:NSLocalizedString(@"Two", @"")],
[NSString stringWithString:NSLocalizedString(@"Three", @"")],
[NSString stringWithString:NSLocalizedString(@"Four", @"")],
nil]];

segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
segmentedControl.tintColor = [UIColor blackColor];

[segmentedControl setSelectedSegmentIndex:0];


[segmentedControl addTarget:self action:@selector(changeSegment:) 
               forControlEvents:UIControlEventValueChanged];

[segmentedControl setFrame:[self.navigationController.toolbar bounds]];

[self.navigationController.toolbar addSubview:segmentedControl];
[segmentedControl release];
</code></pre>

<p>I have tried this code and the segments don't appear to be selected with I touch them.</p>

<p>Is this the correct way of doing that?</p>

<p>thanks.</p>
