iOS Zbar bad access..

IDMah

macrumors 6502
Original poster
May 13, 2011
295
9
I tried to run zbar with a view. which didn't work..
Code:
// ala this..
- (void) viewDidLoad
{
    [super viewDidLoad];
    
    reader = [[ZBarReaderViewController alloc] init];
    
    reader.readerDelegate = self;
    reader.showsZBarControls = NO;
    reader.supportedOrientationsMask = ZBarOrientationMaskAll;
    
    ZBarImageScanner *scanner = reader.scanner;
    
    [scanner setSymbology: 0
                   config: ZBAR_CFG_ENABLE
                       to: 0];
    
    [scanner setSymbology: ZBAR_QRCODE
                   config: ZBAR_CFG_ENABLE
                       to: 1];
    
    reader.readerView.frame = CGRectMake(self.view.frame.size.width* 0.015,self.view.frame.size.height*0.05375,
                                         self.view.frame.size.width *0.965625, 350);
    // 309, 350 //
    
    reader.readerView.alpha = 0.5;
    
    [self.view addSubview:reader.readerView];
    
}
but now I get a Thread 1:EXC_BAD_ACESSS (code=2, address=0x17)
in this: libobjc.A.dylib`_ZL12realizeClassP7class_t:
and libobjc.A.dylib`_class_lookupMethodAndLoadCache3:

even after changing everything back.. tried cleaning.
tried rebooting simulator. exiting and restarting Xcode..
Not sure where things are mucking up???

HELP !!! :confused:

thanks
Ian


ps. It was running fine last night. Compiled clean.. the only thing I added and then deleted was the above code..
 
Last edited:

waterskier2007

macrumors 68000
Jun 19, 2007
1,815
145
Novi, MI
Why did you decide to run it this way. Why not have it load up when you hit a button or some other sort of action? That's the way I have it set up and it works fine. Something worth noting however, is that for a while I could not get it to work. I was in one of the Dev builds of XCode 4.4 and then I upgraded to the 3rd preview and it started working.
 
Comment

IDMah

macrumors 6502
Original poster
May 13, 2011
295
9
sort of fixed by giving up hahaaa !!!!

Hi WaterSkier I was trying to do that.. do you have an example?
obviously the example I found was not great..

I want to keep the app as "mom" proof as possible,camera screen confuses my mom.
So would like Zbar to live on a NSView Which says .. "Please scan QR code. "
Above the Zbar (live video) screen (CameraView) .. With an overlay of a
QR Code to be extra "mom" proof.

I think I did manage to fix it. buy Reverting back to previous code.
and I dropped the ZBar in to project so it's just a library. Not Sub-project.
but thanks.. Using Xcode 4.3.2 release..

thanks
Ian

ps. that said getting a "Thread 1 SIGTRAP" error when I run on iPad simulator.. ugh!
 
Last edited:
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.