It strikes me that this is a bad place to add your UISegmentedControl, since viewWillAppear: can get called multiple times for a particular UIViewController - for example if your view is covered and then exposed again, it will be called again.
Normally, I would think that you would do this in your "initWithNibName:bundle:" routine after having called the "super" version thereof.
That being said, it strikes me as a slightly odd user interface to have a UISegmentedControl in the nav bar's right button. But, then, who am I to say what's "good" and what's "bad".
Another nit - you've called "alloc" to create both the UISegmentedControl and the UIBarButtonItem, but haven't made a corresponding call to "release" in either case.
|