Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4099034
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:22:52+00:00 2026-05-20T20:22:52+00:00

UPDATED QUESTION: Hello , so I was able to create the modal view curl

  • 0

UPDATED QUESTION:
Hello , so I was able to create the modal view curl up overlay for this use. However I now have the issue that I can click on the button1 and pull up second view with the url1 on webView1, but when I click button2 I receive the display of url1 on webview also. below is the code can you help me out on what I’m doing wrong?

FourthViewController.h has the following code:

‘

#import <UIKit/UIKit.h>


@interface FourthViewController : UIViewController {
    UIButton *openBlogButton, *openFbButton, *openYelpButton;
}

@property (nonatomic, retain) IBOutlet UIButton *openBlogButton, *openFbButton, *openYelpButton;


-(IBAction)openBlog:(id)sender;
-(IBAction)openFacebook:(id)sender;
-(IBAction)openYelp:(id)sender;

@end

‘

FourthViewController.m has the following code:

‘

#import "FourthViewController.h"
#import "FourthBlogWebViewController.h"
#import "FourthFBWebViewController.h"


@implementation FourthViewController

@synthesize openBlogButton, openFbButton, openYelpButton; 

-(IBAction)openBlog:(id)sender {
    FourthBlogWebViewController *sampleView = [[[FourthBlogWebViewController alloc] init] autorelease];
    [sampleView setModalTransitionStyle:UIModalTransitionStylePartialCurl];
    [self presentModalViewController:sampleView animated:YES];
}

//THIS IS WHERE I THINK THE ISSUE IS, WHEN I CLICK openFacebook it should lead to the fb URL, it seems as if I should be able to list all possible urls on the first fourthwebviewcontroller, but i was not able to be successful so I tried making a second webview controller to feed it this url but this failed...lol. thnx for any input.
-(IBAction)openFacebook:(id)sender {
    FourthFBWebViewController *sampleView = [[[FourthFBWebViewController alloc] init] autorelease];
    [sampleView setModalTransitionStyle:UIModalTransitionStylePartialCurl];
    [self presentModalViewController:sampleView animated:YES];
}

-(IBAction)openYelp {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.yelp.com"]];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

- (void)viewDidUnload {
    [super viewDidUnload];
}


- (void)dealloc {
    [openBlogButton release];
    [openFbButton release];
    [openYelpButton release];
    [super dealloc];
}


@end

‘

FourthBlogWevViewController.h

‘

#import <UIKit/UIKit.h>


@interface FourthBlogWebViewController : UIViewController {
    UIButton *dismissViewButton;
    IBOutlet UIWebView *webViewFB;
}

@property (nonatomic, retain) IBOutlet UIButton *dismissViewButton;
@property (nonatomic, retain) UIWebView *webViewFB;

- (IBAction)dismissView:(id)sender;

@end'

FourthBlogWebViewController.m code:

'#import "FourthBlogWebViewController.h"


@implementation FourthBlogWebViewController

@synthesize dismissViewButton, webViewFB;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
    }
    return self;
}

-(IBAction)dismissView:(id)sender {
    [self dismissModalViewControllerAnimated:YES];
}

- (void)viewDidLoad {
    NSString *urlAddress = @"http://www.facebook.com";  
    NSURL *url = [NSURL URLWithString:urlAddress];
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
    [webViewFB loadRequest:requestObj];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

- (void)viewDidUnload {
    [super viewDidUnload];
}


- (void)dealloc {
    [dismissViewButton release];
    [webViewFB release];
    [super dealloc];
}


@end

Where or how would I add the second url and have it distinguis on click of other buttons. Thank you in advance for the ongoing help.


Original Question:
Hello,

So first app and I’m trying to make some basic function use of buttons, Im doing this in a tab bar application. On my fourth tab view a view opens with 3 buttons, on the click of the button I am trying to get a webpage to load within the app (i was able to successfully make the webpages open via safari on button touchup inside click, but that is not how I want it to load. So I edited the way it loads and on push of button the website is now opening within the webView. However I want to create this webview on a new view rather then on the same view where the 3 buttons are, but I’m not clear on how to do this. Any input would be greatly appreciated (I apologize beforehand since this seems as an easy task, but haven’t figured it out yet, I did some searching before asking, but was unable to find anything that showed how to do this on push of different button to load webview on a new view within the same XIB.

Thanks.

Below is the code that I have for the load of webview on push of button.

On fourthviewcontroller.h

#import <UIKit/UIKit.h>

@interface FourthViewController : UIViewController {
    IBOutlet UIWebView *webView;
}

-(IBAction)openWebsite:(id)sender;
-(IBAction)openButton2;
-(IBAction)openButton3;

@property (nonatomic, retain) UIWebView *webView;

@end

On fourthviewcontroller.m

#import "FourthViewController.h"

@implementation FourthViewController

@synthesize webView;

-(IBAction)openWebsite:(id)sender{
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.URL.com"]]];
}

-(IBAction)openButton2:(id)sender{
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.URL2.com"]]];
}

-(IBAction)openButton3:(id)sender{
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.URL3.com"]]];
}

Basically I’m trying to get different buttons to push to the same new view but the only difference is that i want the uiwebview to display a different URL depending on the button click that bring the new view.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T20:22:52+00:00Added an answer on May 20, 2026 at 8:22 pm

    As NWCoder mention, it depends how you like the new webview to be shown.

    Display in UINavigationController-

    1. Make your fourth tab a uinavigationcontroller and set the 3 button view controller as the top most view controller.
    2. Create a new UIViewController that encapsulate the UIWebView.
    3. When user click on the open webview button, create and push the uiviewcontroller that contains the uiwebview

    Display in modal view:

    1. Create a new UIViewController that encapsulate the UIWebView.
    2. When user click on the open webview button, create and push the webview uiviewcontroller by calling the fourth’s tab uiviewcontroller presentModalViewController:animated.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question regarding an update function I created... CREATE OR REPLACE FUNCTION
Hello guys I have a question regardless a old code a client needed a
Hello, we have recently updated an application to Rails 3.0.4 (3.0.5 on online devel
Here is the updated question: the current query is doing something like: $sql1 =
Update: this question, including the title, was rephrased, see history for details I know
Update: Check out this follow-up question: Gem Update on Windows - is it broken?
Update: Please read this question in the context of design principles, elegance, expression of
The same as this question but for java Update Based on the comments and
Duplicate of this question . update - This is not an exact duplicate. See
EDIT Sorry for the confusion, here is my updated question. I am using FindBin

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.