Below is the code snippet I am using to set up my UISegment Control
//Add UIView below the nav bar
UIView *buttonContainer = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 30)];
[self.view addSubview:buttonContainer];
//Set up segment control
NSString *nicknameLabel = [NSString stringWithFormat:@"%@",self.nickname];
UISegmentedControl *tempSegmentControl = [[UISegmentedControl alloc]initWithItems:[NSArray arrayWithObjects:nicknameLabel,@"Friends", @"Everyone", nil]];
tempSegmentControl.frame = CGRectMake(-8, 44, 336, 30);
self.segmentControl = tempSegmentControl;
[self.segmentControl setWidth:112 forSegmentAtIndex:0];
[self.segmentControl setWidth:112 forSegmentAtIndex:1];
[self.segmentControl setWidth:112 forSegmentAtIndex:2];
self.segmentControl.selectedSegmentIndex = 0;
[self.segmentControl addTarget:self action:@selector(toggleControls:) forControlEvents:UIControlEventValueChanged];
[self.segmentControl setSegmentedControlStyle:UISegmentedControlStylePlain];
[self changeSegmentFontSize];
[tempSegmentControl release];
[buttonContainer addSubview:self.segmentControl];
[self.view bringSubviewToFront:buttonContainer];
[buttonContainer bringSubviewToFront:self.segmentControl];
[buttonContainer release];
However, I in the app, I am unable to switch between the segments for the segmented control. (only show default first segment highlighted)

Any advice on how I can fix this?
It looks like a bounds problem. The containing view has bounds {0, 0, 320, 30} while the segmented control has {-8, 44, 336, 30}. This means the segmented control is technically “outside” its containing view and the iOS hit test will not register a touch.
Try not setting the segmented control’s frame (temporarily comment out the
tempSegmentControl.frame = CGRectMake(-8, 44, 336, 30);line) and see what happens.