Scandit条码扫描器iOS崩溃

时间:2013-05-02 02:47:21

标签: ios crash barcode qr-code

我安装了SDK(2.2.7)并包含了xCode(4.6.2)项目中的所有框架。每当我尝试扫描代码时,它都会崩溃:

int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

扫描视图的getter

- (ScanditSDKBarcodePicker *)scanPicker
{
    if (!_scanPicker)
    {
        _scanPicker = [[ScanditSDKBarcodePicker alloc] initWithAppKey: SCANDIT_APP_KEY];
        UIBarButtonItem *guestButton = [[UIBarButtonItem alloc] initWithTitle:@"List" style:UIBarButtonItemStylePlain target:self action:@selector(choseFromList:)];
        _scanPicker.navigationItem.rightBarButtonItem = guestButton;
        UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithTitle:@"cancel" style:UIBarButtonItemStylePlain target:self action:@selector(cancelPicker:)];
        _scanPicker.navigationItem.leftBarButtonItem = cancelButton;
        _scanPicker.overlayController.delegate = self;
        [_scanPicker startScanning];
    }
    return _scanPicker;
}

呈现它的代码

- (void)presentScanditViewController
{
    UINavigationController *navi = [[UINavigationController alloc] initWithRootViewController:self.scanPicker];
    [self presentViewController:navi animated:YES completion:nil];
}

我也检查了应用程序密钥,有没有人有同样的问题?

2 个答案:

答案 0 :(得分:0)

糟糕的支持和文档SDK,交换到ZBar

答案 1 :(得分:0)

我偶尔也会从Scandit看到这个错误,但这只是每天所有扫描的一小部分。

我使用Scandit网站Scandit iOS SDK Implementation Documentation

上的文档实现了它

我从ZBar开始,但Scandit代码比ZBar工作更多,特别是在固定焦距相机(iPod Touch 4th Gen)上。

这是我分配和展示扫描仪的代码

- (IBAction)scanImage:(id)sender
{
picker = [[ScanditSDKBarcodePicker alloc] initWithAppKey:scanditAPIKey];
picker.overlayController.delegate = self;
[picker startScanning];
[self presentViewController:picker animated:YES completion:nil];
}