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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:41:14+00:00 2026-06-01T02:41:14+00:00

I know this is extremely silly. I have a view controller that scans a

  • 0

I know this is extremely silly.

I have a view controller that scans a QR code. I create it in the AppDelegate (didFinishLaunchingWithOptions), and I also set my AppDelegate as a delegate for the the view controller which will call a method when he finishes scanning the code. In that method, that I have implemented in the AppDelegate I want to present a UINavigationController. The problem is that it is not presenting my navigation controller. This is my code:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    reader=[ZBarReaderViewController new];
    reader.readerDelegate=self;
    reader.supportedOrientationsMask=ZBarOrientationMaskAll;
    ZBarImageScanner *scanner=reader.scanner;
    [scanner setSymbology:ZBAR_I25 config:ZBAR_CFG_ENABLE to:0]; 


   [self.window addSubview:reader.view];
   [self.window makeKeyAndVisible];
   return YES;
}

-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    RootViewController *rootViewController=[[RootViewController alloc] init ];  //create root view controller

    UINavigationController *navigationController=[[UINavigationController alloc] initWithRootViewController:rootViewController];  // create and init navigation controller with viewController
    [navigationController setValue:[[GradientBar alloc] init] forKey:@"navigationBar"];

    rootViewController.title=@"mTLU";
    [reader presentModalViewController:navigationController animated:NO];

}
  • 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-01T02:41:16+00:00Added an answer on June 1, 2026 at 2:41 am

    Seems like you forgot to set self.window.rootViewController in didFinishLaunchingWithOptions:

    Try:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
       self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
       // Override point for customization after application launch.
       self.reader=[ZBarReaderViewController new];
       self.reader.readerDelegate=self;
       self.reader.supportedOrientationsMask=ZBarOrientationMaskAll;
       ZBarImageScanner *scanner=reader.scanner;
       [scanner setSymbology:ZBAR_I25 config:ZBAR_CFG_ENABLE to:0]; 
    
       self.window.rootViewController = self.reader;
    
       [self.window addSubview:reader.view];
       [self.window makeKeyAndVisible];
       return YES;
    }
    

    This code assumes reader is property of AppDelegate. If it’s only iVar you should ommit self. (or consider making it a property).

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

Sidebar

Related Questions

I know that the answer to this is going to be extremely simple and
I know this sounds very dumb, but we have a client that sends out
I know this sounds silly but i forgot how to code non-ajax. Specifically: I
Before I start know this: I am extremely new to Java and programming. How
I know this is largely an opinion, but I'm interested if you have one
I know this can be done and i have seen it done using some
I know this might be a long shot, but here it goes. I have
I know this same question was asked for Entity Framework 1, but now that
I have this extremely simple splash page here: http://iph0wnz.com It has the main graphic
I know this is an extremely simple question... but I do not know the

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.