I want about 3 different blog pages on one tab of my tab bar application. I'd like to have the segmentedcontrol setup to handle this. So far, I have made 3 different view classes, each with a webview that points to a different blog. On the FirstTabViewController I declared the class of all 3 views and set up an IBOutlet for each one. I also declared the IBOutlet for the segmentedcontrol, and hooked up all connections in IB. In the .m file I am running this code:
But, I can't get it to work. Any ideas?
Code:
- (IBAction)changesegment {
if (segment.selectedSegmentIndex == 0) {
[self addSubview: blog1];
}
if (segment.selectedSegmentIndex == 1) {
[self addSubview: blog2];
}
if (segment.selectedSegmentIndex == 2) {
[self addSubview: blog3];
}
}