How To stop text Capture Service In iOS Objective C

  • Last Post 24 January 2018
  • Topic Is Solved
anup gupta posted this 22 January 2018

I was Trying to stop text Capture Service when I m getting particular Keyword in (NSArray*)textlines. 

Ex: I am looking for Anup in a textlines if I find then I want to stop the task. I don't need 
RTRResultStabilityStatus. Because I m only looking for the Keyword Anup. if I find Anup then my task is over. 

So I am Doing [_textCaptureService stopTasks];  

but this is not Stoping text Capture Service 

So How I can achieve this?

#pragma mark - RTRRecognitionServiceDelegate


- (void)onBufferProcessedWithTextLines:(NSArray*)textLines resultStatus:(RTRResultStabilityStatus)resultStatus


    performBlockOnMainThread(0, ^{

        if(!self.isRunning) {



        [self.progressIndicatorView setProgress:resultStatus color:[self progressColor:resultStatus]];

        for(RTRTextLine* textLine in textLines) {

            NSString* recognizedString = textLine.text;

                if ([recognizedString isEqualToString:@"Anup"]) {


                    NSLog(@"YES I m here");

                    [_textCaptureService stopTasks];






This is My code Snippet. 

Order By: Standard | Newest | Votes
anup gupta posted this 22 January 2018



By self.running = NO; need to call first then [_textCaptureService stopTasks];

To stop the process. 

Oksana S. posted this 24 January 2018

Hi Anup,

It seems that for your usage scenario it is more appropriate to use the the Data Capture scenario (please see Capture a Custom Data Field: iOS for details) with the regular expressions for this. Using a regular expression, you can describe a word that you are looking for, and then when you point the camera at the text, containing the necessary word, ABBYY RTR SDK will extract only the word that corresponds to the specified regular expression.

  • Liked by
  • anup gupta
anup gupta posted this 24 January 2018

Hi Oksana,

Thank you. I will Check This.