Scandit条形码扫描仪iOS崩溃

3

我安装了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];
}

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


1
每当您发布有关崩溃的问题时,有两件事是必需的 - 1)完整的错误消息,2)堆栈跟踪的相关部分或指向实际崩溃代码的引用。 - rmaddy
我们可能需要完整的堆栈跟踪来帮助您解决问题。您可以尝试添加异常断点,http://blog.manbolo.com/2012/01/23/xcode-tips-1-break-on-exceptions - Erik
是的,它已经在所有异常上有断点了,但它并不能描述崩溃情况。 - Chris Lin
2个回答

0

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

我使用Scandit网站上的文档Scandit iOS SDK Implementation Documentation进行了实现。

我最初使用ZBar,但是Scandit代码在固定焦距相机(iPod Touch第4代)上的效果比ZBar好得多。

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

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

0

支持和文档都很差的SDK,转向ZBar


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接