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

The Archive Base Latest Questions

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

All I need is to view a UIView controller in same storyboard file manually

  • 0

All I need is to view a UIView controller in same storyboard file manually with code. I use storyboard to make all forms and connections. My application starts in navigation controller, which provides me access to UIView (LoginViewController) and then it goes to tab bar controller, which provides 4 UIViews. According to every UIView I have .h and .m files. I know about segue method, it is simple, but I need manual method. Maybe I am doing something wrong.

I was trying to use this method for pushing view controller in IBAction:

[self.view pushViewController:LoginViewController animated:YES];

But it makes an error:

Unexpected interface name ‘LoginViewController’: expected expression

It took a lot of time to figure out what is wrong, but I had not succeed.
Here is my RollEnemyController.m file:

//  RollEnemyController.m
#import "RollEnemyController.h"
#import "LoginViewController.h"
@implementation RollEnemyController;
@synthesize AttackButtonPressed;

- (IBAction)AttackButtonPressed:(id)sender {
    LoginViewController* controller = [[LoginViewController alloc] initWithNibName:@"LoginViewController"  bundle:nil];
    [self.view pushViewController:controller];
}

@end

And this is header file:

//  RollEnemyController.h

#import <UIKit/UIKit.h>

@interface RollEnemyController : UIViewController

- (IBAction)RollButtonPressed:(id)sender;
@property (weak, nonatomic) IBOutlet UIButton *AttackButtonPressed;

@end
  • 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-27T07:50:44+00:00Added an answer on May 27, 2026 at 7:50 am

    I’m guessing that you are using a UINavigationController. Then you can simply do like this:

    LoginViewController *controller = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];
    [self.navigationController pushViewController:controller animated:YES];
    

    Update:

    If you are using a UIStoryboard, you can set the identifier of your new viewcontroller, and then push it onto your navigationController. To set the identifier, choose your view, open the Attributes Inspector, and set the identifier (“LoginIdentifier” in my example). Then you can do this:

    LoginViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"LoginIdentifier"];
    [self.navigationController pushViewController:controller animated:YES];
    

    As a sidenote, I see that you are using capital characters for your methods. You should probably try to avoid that, and instead use lowered first-characters in your method names. And since you say you are learning Objective-C, you should check out this awesome thread here on SO: link.

    Update 2:

    Here is a zip file with a project showing how to do this. 🙂

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

Sidebar

Related Questions

I have 4 UIViews inside of a main view controller view. All I need
I have created a View controller with some methods I need to use often
I have a simple table view which is editable. All I need the user
I have multiple threads who all need to write to the same Dictionary. I
I have multiple threads (C# application running on IIS) running that all need to
All I need is a way to make a property of one class only
I've been trying to get this code to work for hours! All I need
I have a universal view controller class which all of the view controller classes
how to I introduce use of a NIB file to my existing custom UIView?
In my iphone app, I need to create a controller for which the view

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.