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

  • Home
  • SEARCH
  • 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 5958797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:35:38+00:00 2026-05-22T18:35:38+00:00

I’m having a bit of an issue here switching between my view controllers. I

  • 0

I’m having a bit of an issue here switching between my view controllers.

I followed the advice on this page:

View Controllers: How to switch between views programmatically?

My setup is as follows; I have a splash screen with a button on it and that button loads my second view controller. I have IntroductionViewController as the root view and the button says “Load Website”, this Load Website event I want to switch to WebsiteViewController.

On IntroductionViewController I have set up the button as an IBOutlet and IBAction which is NSLogging fine on Click so I know the method is working.

What I need is when you click Load Website it opens WebsiteViewController. What I have so far is credit of the question above:

IntroductionViewController.h

#import <UIKit/UIKit.h>
#import "WebsiteViewController.h"

@class WebsiteViewController;

@interface IntroductionViewController : UIViewController {
    IBOutlet UIButton *websiteButton;
    IBOutlet WebsiteViewController *websiteViewController;
}
@property (nonatomic, retain) UIButton *websiteButton;
@property (nonatomic, retain) WebsiteViewController *websiteViewController;

-(IBAction)loadWebsite:(id)sender;

@end

IntroductionViewController.m

#import "IntroductionViewController.h"

@implementation IntroductionViewController

@synthesize websiteButton;
@synthesize websiteViewController;

-(IBAction)loadWebsite:(id)sender{
    if(self.websiteViewController.view.superview == nil)
    {
        [self.view addSubview:websiteViewController.view];
    }   
}

The line: [self.view addSubview:websiteViewController.view]; doesn’t do anything, but as I’ve said previously, this function is NSLogging fine. I’m not sure how to proceed with this.

  • 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-22T18:35:39+00:00Added an answer on May 22, 2026 at 6:35 pm

    Possible you may have forgot to bind the IBOutlet to your WebsiteViewController. And for both Orientation support you can use

     - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOr‌​ientation 
     { 
          // Overriden to allow any orientation. 
          return ((interfaceOrientation==UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation==UIInterfaceOrientationLandscapeRight)); 
     }
    

    One more thought for your orientation problem, you can setFrame to your view while displaying like

     - [yourViewController.view setFrame:CGRectMake(0,0,1024,768)] //iPad and 
     - [yourViewController.view setFrame:CGRectMake(0,0,480,320)] //iPhone.
    

    May be this works.

    Thax.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm making a simple page using Google Maps API 3. My first. One marker
I have some data like this: 1 2 3 4 5 9 2 6

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.