无法识别的选择器发送到类0x865c6c

时间:2013-10-01 05:17:04

标签: ios objective-c zbar-sdk zbar

我正在尝试将Zbar sdk集成到我收到此错误。

"+[QRCodeReadViewController presentViewController:animated:]: unrecognized selector sent to class 0x865c74";

提前致谢

我的代码是

    +(void)startfn{

        ZBarReaderViewController *reader = [ZBarReaderViewController new];
        reader.readerDelegate =self;
        ZBarImageScanner *scanner = reader.scanner;

        [scanner setSymbology: ZBAR_I25
                       config: ZBAR_CFG_ENABLE
                           to: 0];

          [self presentViewController:reader animated:NO];
    [reader release];
}

1 个答案:

答案 0 :(得分:1)

不是startfn类方法吗?在这种情况下,self引用类QRCodeReadViewController而不引用该类的实例,因此您无法调用presentViewController:animated:completion:这是UIViewController实例的方法