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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:27:50+00:00 2026-05-21T04:27:50+00:00

I have an application which has a number of views which are navigated to

  • 0

I have an application which has a number of views which are navigated to via a number of custom UIButtons from my main view. The main view is named iBMRViewController and features some welcome graphics in the form of PNG images dropped in through interface builder. It also features 6 custom UIButtons which I have created through code using the following;

// This is the code which creates, and defines the properties of the 'Warning' button on the main view.
    UIButton *warningButton = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
    warningButton.frame = CGRectMake(225.0, 270.0, 60.0, 60.0);
    [warningButton setTitle:@"" forState:UIControlStateNormal];
    warningButton.backgroundColor = [UIColor clearColor];
    [warningButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal ];
    UIImage *warningButtonImageNormal = [UIImage imageNamed:@"Warning.png"];
    UIImage *warningStretchableButtonImageNormal = [warningButtonImageNormal stretchableImageWithLeftCapWidth:12 topCapHeight:0];
    [warningButton setBackgroundImage:warningStretchableButtonImageNormal forState:UIControlStateNormal];
    UIImage *warningButtonImagePressed = [UIImage imageNamed:@"whiteButton.png"];
    UIImage *warningStretchableButtonImagePressed = [warningButtonImagePressed stretchableImageWithLeftCapWidth:12 topCapHeight:0];
    [warningButton setBackgroundImage:warningStretchableButtonImagePressed forState:UIControlStateHighlighted];
    [warningButton addTarget:self action:@selector(warningButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:warningButton];

Now, this all works fine and the buttons function perfectly, obviously I also have Actions set up for them which work perfectly. On each page I have a UINavigationBar with a UINavigationItem on set up through interface builder and set to take me back to my main view using the following code;

//This is the code which opens up the new view when 'Begin' button is tapped.
-(IBAction)beginHomeButtonAction:(id)sender {
    iBMRViewController *controller = [[BeginView alloc] initWithNibName:@"iBMRViewController" bundle:nil];
    controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:controller animated:YES];
    [controller release];

This also works, however, when it takes me back to the ‘iBMRViewController’ it ONLY displays what was set up via the interface builder xib file (i.e. the welcome png files). It does not display the buttons I added through code.

Can anyone give me an idea of where I have gone wrong? Would be extremely appreciated.

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-21T04:27:51+00:00Added an answer on May 21, 2026 at 4:27 am

    In fact, the beginHomeButtonAction doesn’t “take you back to the main view”. It creates a new view controller, with a new view, and presents that. It’s the same kind of controller class, but not the same instance of that class.

    To dismiss the view, and in fact take the user back to the main view, you have to dismiss the view that you presented from the main view. How to do this depends on how you presented then, but you could try popViewControllerAnimated or dismissModalViewControllerAnimated. (google is your friend)

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

Sidebar

Related Questions

I have a basic ASP.Net MVC 3 application which has a number of controllers
I have an application written using Prism 4.0. It has lots of Views which
I have an application which has a similar interface to Visual Studio, in that
I have an application which has a Projects table and a Users table. In
We have an application which has about 15000 pages. For better SEO reasons we
I have an Erlang application which has a dependency in its deps directory on
I have an MVC application which has a set of fields for contact details
I have an iphone application which has about 4 tabs. How do I force
I have a Windows application which has a browser in it. The Windows application
I have a Java Application which has to load an DLL with a few

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.