File tree Expand file tree Collapse file tree
IOS/SDK/LuaViewSDK/Classes/lvsdk Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -193,7 +193,9 @@ - (void)captureOutput:(AVCaptureOutput *)output didOutputMetadataObjects:(NSArra
193193 for (AVMetadataObject *metadata in metadataObjects){
194194 if ([metadata.type isEqualToString: AVMetadataObjectTypeFace]){
195195 CGRect face = [self .previewLayer rectForMetadataOutputRectOfInterest: metadata.bounds];
196- [self onFaceDetected: face];
196+ dispatch_async (dispatch_get_main_queue (), ^{
197+ [self onFaceDetected: face];
198+ });
197199#ifdef DEBUG
198200 CGPathAddRect (path, NULL , face);
199201#endif
Original file line number Diff line number Diff line change @@ -63,10 +63,10 @@ -(void) startTimer{
6363 if ( self.delay >0 ) {
6464 NSDate * date = [[NSDate alloc ] initWithTimeIntervalSinceNow: self .delay];
6565 timer = [[NSTimer alloc ] initWithFireDate: date interval: self .interval target: self selector: @selector (timerCallBack ) userInfo: nil repeats: self .repeat];
66- [[NSRunLoop currentRunLoop ] addTimer: timer forMode: NSRunLoopCommonModes ];
66+ [[NSRunLoop mainRunLoop ] addTimer: timer forMode: NSRunLoopCommonModes ];
6767 } else {
6868 timer = [NSTimer scheduledTimerWithTimeInterval: self .interval target: self selector: @selector (timerCallBack ) userInfo: nil repeats: self .repeat];
69- [[NSRunLoop currentRunLoop ] addTimer: timer forMode: NSRunLoopCommonModes ];
69+ [[NSRunLoop mainRunLoop ] addTimer: timer forMode: NSRunLoopCommonModes ];
7070 }
7171}
7272
You can’t perform that action at this time.
0 commit comments