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

bobbypotluck

macrumors member
Original poster
Feb 18, 2009
70
0
I'm trying add a segmented controller in a navigation bar in my app which is imbedded in a tab. I'm able to add the navigation controller and segmented buttons to the tab in IB. I read that i need to do something with segmentAction: I'd like the segmented buttons to just change the URL of the webview. To load the URL in the view i'm using this code in the views .m

-(void)awakeFromNib {
[HomePage loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:mad:"http://m.singletracks.com/map2.php"] ]];

Can someone get my started with what my code should look like to change the URL when different segment buttons are pressed?
 
So, you already have your UISegmentedControl triggering the segmentAction: method, is that correct? If so, then inside that method, based on the selected segment index, you'll want to do pretty much what you are doing inside your awakeFromNib.
 
i do not have it triggering that method yet no. All i know is that i read have to do something with the segmentAction: method. All i've done is added the segmented buttons in interface builder, i have not done any code with them at all.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.