Implementing Back and Forth Control.
Implementing Back and Forth Control.
- Subject: Implementing Back and Forth Control.
- From: Philip Juel Borges <email@hidden>
- Date: Tue, 13 Oct 2009 11:53:33 +0200
Hi!
In my app I have my MainMenu.xib that contains the toolbar and a
custom view that swaps in my other 3 xib (view) files (taken from
ViewControlller from Appple's site). Now each of the other 3 views has
a webview and a segmented control that allows me to go back and forth
and adding this code to the corresponding class files makes it work.
- (IBAction)controlClicked:(id)sender {
int selectedSegment = [sender selectedSegment];
int clickedSegmentTag = [[sender cell]
tagForSegment:selectedSegment];
switch (clickedSegmentTag)
{
case 0:
[webView goBack:self];
break;
case 1:
[webView goForward:self];
break;
}
}
But it would be better to have just one segmented control in the
toolbar that can go back and forth in any of the views that is swapped
in.
An alternative would be to have one webview in my MainMenu.xib and let
the other 3 views display html there, but that I don't know how to do.
I've googled this for long now and thought that perhaps this would
work but it doens't [[webView window] goBack:self];
Any ideas on this one?
--Philip
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden