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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:09:10+00:00 2026-05-29T06:09:10+00:00

Newbie here programming my first app (having made several tutorial apps). I am using

  • 0

Newbie here programming my first app (having made several tutorial apps). I am using a view controller called ‘RootViewController’ as a navigation controller. I have successfully pushed another view controller on top of this called ‘ClientListViewController’ using the command:

[self.navigationController pushViewController:clientListViewController animated:YES];

I am now in the ClientListViewController and trying to push another view controller onto the stack called ‘AddClientViewController’. I would like to make this a modal view controller in the form of a UIModalPresentationFormSheet. I am trying to use a variation of the command above to push the new view controller but i don’t know how to replace the ‘self’. I have tried:

[RootViewController.navigationController pushViewController:AddClientViewController animated:YES];

and…

[[RootViewController navigationController] pushViewController:AddClientViewController animated:YES];

as well as each of these combinations using small ‘R’s for the word Root. Still no luck.

For clarity, I have used the following code at the top of my implementation file.

#import "AddClientViewController.h"

Am I approaching this in the right way, or should I be using a brand new navigation controller to add it to?

Any pointers greatly received.

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-29T06:09:10+00:00Added an answer on May 29, 2026 at 6:09 am

    Every UIViewController has a property named navigationController. This property refers to the nearest enclosing UINavigationController, if there is one. So you can just say self.navigationController in your ClientListViewController.

    In iOS, we normally capitalize class names. So it sounds like AddClientViewController is a class name. You need to have an instance of that class to push it on the navigation controller’s stack. Something like this:

    AddClientViewController *addClientVC = [[AddClientViewController alloc] init];
    [self.navigationController pushViewController:addClientViewController animated:YES];
    

    You might need to use a different init method or set some properties of addClientVC before pushing it; that depends on your implementation of AddClientViewController.

    If you want to present it modally, you don’t push it on the navigation controller’s stack. Instead you do it this way:

    AddClientViewController *addClientVC = [[AddClientViewController alloc] init];
    addClientVC.modalPresentationStyle = UIModalPresentationFormSheet;
    [self presentViewController:addClientVC animated:YES completion:nil];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Pardon the dumb newbie question here; web programming isn't my forte... (blush) I have
I'm a socket programming newbie. Here's a snippet: struct sockaddr_storage client_addr; ... client_addr_size =
First of all a statement: I'm a newbie when it comes to programming for
I'm a complete newbie to programming and am having a lot of trouble with
JasperReports newbie here. I have read the tutorial and the quick reference and read
Newbie here. I'm using codeigniter and mysql How can I dynamically (number of names
Programming newbie here, about a month in with Ruby. I'm currently playing around with
I'm a newbie here and in XNA programming, but I have some skills in
I'm a newbie into Android programming... Here's what I'm trying to do for a
Newbie here...can I write one program which incorporates .NET LINQ and also various Java

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.