ios - iPhone 5 真机下 使用扫一扫功能 扫描二维码,用苹果自带正则表达式却崩溃了
大家讲道理
大家讲道理 2017-04-18 09:36:10
0
2
686
大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(2)
Peter_Zhu

Apple Documentation:

"This method may be called frequently, your implementation should be efficient to prevent capture performance problems, including dropped metadata objects."

So the matter of controlling the number of scans needs to be handled by our developers. . .

巴扎黑

I don’t know why the scan function of iPhone5 is different from other models. The camera function of iPhone5 will call this method repeatedly when it is not completely exited
- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects:(NSArray *)metadataObjects fromConnection:(AVCaptureConnection *)connection,

The stringValue scanned out is a URL

NSTextCheckingResult * firstWebUrl = [regex firstMatchInString:stringValue options:0 range:NSMakeRange(0, [stringValue length])];

However, if you call multiple times, null values ​​will be swept out, and stringValue will become null, causing a crash

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template