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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:08:34+00:00 2026-06-10T09:08:34+00:00

I have a working project, one of the screen is for example ViewController 1

  • 0

I have a working project, one of the screen is for example ViewController 1 – tableView. i am trying to pass data and navigate to ViewController 2 after selecting a row in ViewController 1. I added this code:

DetailViewController *dvController = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:[NSBundle mainBundle]];
dvController.selectedItem = selectedItem;
[self.navigationController pushViewController:dvController animated:YES];
[dvController release];

But its not passing to ViewController 2. I think the problem is with navigatorController.
Where should I add it? to xib file of ViewController 1? or to the mainAppDelegate – I dont want to touch it because its already working with its settings…

I declared UINavigationController *navigationController in my appDelegate

What should I check?

After some changes to to code (thanks to @Vakul Saini)
appDelegate.m:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  self.View1 = [[startSearching alloc] initWithNibName:@"StartSearching" bundle:nil];
self.currentNC = [[UINavigationController alloc] initWithRootViewController:self.View1];

//this line start the startSearching at the begining and its passing to //secondViewController
    self.window.rootViewController = self.currentNC;

// but with this line its start from the original start page but the transfer of views //doesn’t wroks

 [self.window setRootViewController: self.viewController];

appDelegate.h

@property (strong, nonatomic) startSearching *View1;
@property (strong, nonatomic) UINavigationController *currentNC;

startSearching.m

detailCon *detailCo =[[detailCon alloc] initWithNibName: @"detailView" bundle: [NSBundle mainBundle]];
[detailCon release];
UINavigation *currentNC1 = [[AppDelagate sharedInstance] currentNC];
[currentVC1 pushViewController:detailCo animated:YES];
  • 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-06-10T09:08:35+00:00Added an answer on June 10, 2026 at 9:08 am

    Check you have a UINavigationController in your Appdelegate or not. You need to make your app rootViewController is UINavigationController
    Add your UINavigationController in appdelegate

    Appdelegate.h file

    #import <UIKit/UIKit.h>
    
    @class ViewController;
    
    @interface AppDelegate : UIResponder <UIApplicationDelegate>
    
    @property (strong, nonatomic) UIWindow *window;
    @property (strong, nonatomic) ViewController *viewController;
    @property (strong, nonatomic) UINavigationController *navCon;
    
    @end
    

    Appdelegate.m file

    #import "AppDelegate.h"
    #import "ViewController.h"
    
    @implementation AppDelegate
    
    @synthesize window = _window;
    @synthesize viewController = _viewController;
    @synthesize navCon = _navCon;
    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
        // Override point for customization after application launch.
        self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
        self.navCon = [[UINavigationController alloc]initWithRootViewController:self.viewController];
        self.window.rootViewController = self.navCon;
        [self.window makeKeyAndVisible];
        return YES;
    }
    

    Where ViewController is your firstView of app.

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

Sidebar

Related Questions

I have a working project that Im amending, it crashes after trying to use
I am working on project where I have the checkInternet method in one of
I have web application Project having RPC call. one RPC async is working fine.
I have a project working fine under MSVS 2010 SP1. I'm trying to convert
I am working on a project and i have tested it on nexus one.
I'm working on a Java GUI project; in one of its property screen I
I am working on android project in which I have to apply loading screen
I have working with a project and i added a share button to product
I have a working C2DM project, atm. I have me and my colleagues phones
I have been working on a project in C# (.net4). Project pretty much allows

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.