I know how to add a UISegmentedControl
to a UIToolBar
from within IB, but I am trying to do the same programmatically, because I am using a custom subclass of UISegmentedControl
with doesn't have an XIB.
This is the code for the UISegmentedControl
:
SVSegmentedControl *navSC = [[SVSegmentedControl alloc] initWithSectionTitles:[NSArray arrayWithObjects:@"List", @"Calendar", nil]];
navSC.delegate = self;
[self.view addSubview:navSC];
[navSC release];
navSC.center = CGPointMake(160, 70);
I was thinking of doing something like [self.toolbar addSubview:navSC]
, but that didn't show anything.
awakeFromNib
. – Incardination