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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:27:42+00:00 2026-06-04T04:27:42+00:00

I am running into an issue that seems so simplistic, is frustrating. I am

  • 0

I am running into an issue that seems so simplistic, is frustrating. I am using the zbar library to play around with scanning qr-codes. Here is my code:

- (IBAction)scanButtonTapped:(id)sender {

// ADD: present a barcode reader that scans from the camera feed
ZBarReaderViewController *reader = [ZBarReaderViewController new];
reader.readerDelegate = self;
reader.supportedOrientationsMask = ZBarOrientationMaskAll;
reader.showsZBarControls = NO;

UIButton *overlay = [UIButton buttonWithType:UIButtonTypeCustom];
overlay.frame = CGRectMake(0, 0, 320, 480);
[overlay setImage:[UIImage imageNamed:@"CameraCover.png"] forState:UIControlStateNormal];
reader.cameraOverlayView = overlay;

overlay.userInteractionEnabled = YES;
[overlay addTarget:self action:@selector(beginScanning:) forControlEvents:UIControlEventTouchUpInside];




ZBarImageScanner *scanner = reader.scanner;
// TODO: (optional) additional reader configuration here

// EXAMPLE: disable rarely used I2/5 to improve performance
[scanner setSymbology: ZBAR_I25
               config: ZBAR_CFG_ENABLE
                   to: 0];

// present and release the controller
[self presentModalViewController: reader
                        animated: NO];
[reader release];



}

- (void) imagePickerController: (UIImagePickerController*) reader
didFinishPickingMediaWithInfo: (NSDictionary*) info
{
// ADD: get the decode results
id<NSFastEnumeration> results =
[info objectForKey: ZBarReaderControllerResults];
ZBarSymbol *symbol = nil;
for(symbol in results)
    // EXAMPLE: just grab the first barcode
    break;

// EXAMPLE: do something useful with the barcode data
resultText.text = symbol.data;

// EXAMPLE: do something useful with the barcode image
resultImage.image =
[info objectForKey: UIImagePickerControllerOriginalImage];


// ADD: dismiss the controller (NB dismiss from the *reader*!)
[reader dismissModalViewControllerAnimated: YES];

[self pushNewScreen];

}

-(void) pushNewScreen
{
MainViewController *mainView = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];
[self presentModalViewController:mainView animated:YES];
[mainView release];
}

The problem is, when pushNewScreen is called, mainView is not shown… I have gone through each line with the debugger and every line in pushNewScreen is called. Any ideas?

  • 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-04T04:27:43+00:00Added an answer on June 4, 2026 at 4:27 am

    Thanks to A-Live, I was able to solve it using

    - (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion 
    

    instead. Hope this helps someone else!

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

Sidebar

Related Questions

I'm running into an issue that seems to only appear on Windows 7. It
I'm running into an issue with loadable bundles and KVO. It seems that any
I'm running into issue which seems to indicate that ActionController::TestCase.get() method ignores what I
I'm running into a weird issue that I'm struggling to figure out what's causing
I'm running into an issue in that I have a document indexed with elasticsearch
I am running into an issue with the way my asynctasks are executed. Here's
I am running into an issue similar to the one described here: NSFetchedResultsControllerDelegate not
I'm using C# and WebForms and running into an issue. I have a class
I'm currently using Entity Framework and am running into this issue: The relationship between
I am running into a strange issue in perl that I can't seem to

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.