Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

newtoiphonesdk

macrumors 6502a
Original poster
Jul 30, 2010
567
2
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:
Code:
- (IBAction)changesegment {
	if (segment.selectedSegmentIndex == 0) {
		[self addSubview: blog1];
	}
	if (segment.selectedSegmentIndex == 1) {
		[self addSubview: blog2];
	}
	if (segment.selectedSegmentIndex == 2) {
		[self addSubview: blog3];
	}
}
But, I can't get it to work. Any ideas?
 
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.
Why not just have one viewController with a webView and you change the content (url) based on the desired segment?

But, I can't get it to work.
You'll need to be a little more specific. What's not working? Errors, warnings, etc.?
 
Why not just have one viewController with a webView and you change the content (url) based on the desired segment?


You'll need to be a little more specific. What's not working? Errors, warnings, etc.?

I have it working now
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.