IOS7自带的二维码扫描功能
#pragma mark AVCaptureMetadataOutputObjectsDelegate - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects:(NSArray *)metadataObjects fromConnection:(AVCaptureConnection *)connection { NSString *stringValue; if ([metadataObjects count] >0) { AVMetadataMachineReadableCodeObject * metadataObject = [metadataObjects objectAtIndex:0]; stringValue = metadataObject.stringValue; _readStr=stringValue; if ([_readStr hasPrefix:@"##px"]) { // NSLog(@"是"); _friend_id = [_readStr substringFromIndex:4]; [self requestHTTPWithNum:1]; } else { // NSLog(@"不是"); UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:_readStr delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; [alert show]; } } [_session stopRunning];
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。