在使用ZBarSDK二维码扫描时,报以下错误:
2013-10-18 14:56:13.095 WebImageTest[284:60b] Unknown class ZBarReaderView in Interface Builder file.
2013-10-18 14:56:13.108 WebImageTest[284:60b] -[UIView setReaderDelegate:]: unrecognized selector sent to instance 0x17d704d0
2013-10-18 14:56:13.112 WebImageTest[284:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setReaderDelegate:]: unrecognized selector sent to instance 0x17d704d0'
*** First throw call stack:
(0x305d4f53 0x3a8fc6af 0x305d88e7 0x305d71d3 0x30526598 0x4b475 0x4b36f 0x32d4a603 0x32d4a3c1 0x32ed6d43 0x32df4a83 0x32df488d 0x32df4825 0x32d46023 0x329cf24b 0x329caa5b 0x329ca8ed 0x329ca2ff 0x329ca10f 0x329c3e3d 0x305a01d5 0x3059db79 0x3059debb 0x30508ce7 0x30508acb 0x351e1283 0x32daaa41 0x4b987 0x3ae04ab7)
libc++abi.dylib: terminating with uncaught exception of type NSException
解决方案如下:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
......
// force view class to load so it may be referenced directly from NIB [ZBarReaderView class];
[ZBarReaderView class];
......
}