How To stop text Capture Service In iOS Objective C Answered

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. 

Was this article helpful?

0 out of 0 found this helpful



  • Avatar
    anup gupta



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

    To stop the process. 

  • Avatar
    Oksana Serdyuk

    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.

  • Avatar
    anup gupta

    Hi Oksana,

    Thank you. I will Check This. 


Please sign in to leave a comment.