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 6920105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:06:20+00:00 2026-05-27T10:06:20+00:00

I am looking for a quicker method to build my application. As i have

  • 0

I am looking for a quicker method to build my application. As i have a series of buttons they all going to open a UIWebView. But each button is going to different website.

May I know is it possible that I just make one xib file? Or should I just create a new file for each of the button?

Here is my code for going to the next xib.

- (IBAction)items:(id)sender {

        //toggle the correct view to be visible
        Chelseapic *myView1 =[[Chelseapic alloc] initWithNibName:nil bundle:nil];
        [myView1 setModalTransitionStyle:UIModalTransitionStylePartialCurl];
        [self presentModalViewController:myView1 animated:YES];
    }

And this is the code for opening URL in the WebView xib.

- (void)viewDidLoad
{       
    [super viewDidLoad];
    NSString *urlAddress = @"http://www.google.com" ;
    NSURL *url = [NSURL URLWithString:urlAddress];
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
    [webView loadRequest:requestObj];
    [self.view addSubview:webView];

}

Many thanks

  • 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-27T10:06:20+00:00Added an answer on May 27, 2026 at 10:06 am

    If you have a fixed set of buttons that you want to lay out in your nib, try making a separate IBAction for each button:

    // helper method
    - (void)presentViewControllerForURL:(NSURL *)url
    {
        Chelseapic *vc = [[Chelseapic alloc] initWithNibName:nil bundle:nil];
        vc.url = url;
        [vc setModalTransitionStyle:UIModalTransitionStylePartialCurl];
        [self presentModalViewController:vc animated:YES];
    }
    
    // Connect the first button in your nib to this action.
    - (IBAction)presentGoogle:(id)sender
    {
        [self presentViewControllerForURL:[NSURL URLWithString:@"http://www.google.com/"]];
    }
    
    // Connect the second button in your nib to this action.
    - (IBAction)presentStackOverflow:(id)sender
    {
        [self presentViewControllerForURL:[NSURL URLWithString:@"http://stackoverflow.com/"]];
    }
    
    // etc.
    

    You’ll need to give Chelseapic a url property that it uses in viewDidLoad, instead of hardcoding the URL there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for quicker ways to navigate in vim. Say, I open the following
I have an application where users are able to upload pictures in albums but
Looking for a Linux application (or Firefox extension) that will allow me to scrape
Looking for suggestions on file system management tools. We have several terabytes of images,
I am looking for an issue tracking application, which has two levels in its
I have tested my pages in Firefox & IE and looking at Firebug in
We have a massive client facing web application here. We recently re-wrote the buy
I have a task, which I know how to code (in C#), but I
What is people's prefered method of storing application configuration data in a database. From
I'm looking for a library that has functionality similar to Perl's WWW::Mechanize , but

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.