Report Viewer Delegate with Methods for Getting Information on Search Results

Description: class implementing a protocol of report viewer delegate with methods for getting information on search results.

The ProceduralDelegateImplForSearch.h File

#import <Foundation/Foundation.h>
#import "MAProceduralReportDataViewController.h"
// Class implementing a protocol of report viewer delegate with methods for getting information on search results
@interface ProceduralDelegateImplForSearch : NSObject<ProceduralDelegate>
// Number of search results
@property (nonatomic, assign) int resultsCount;
// Returns number of search results
- (int) searchResultsCount;
// Called on search finish
- (void) searchFinished;
// Resets search results
-(void) reset;
// Called on finding match with specified string in regular report
-(void) resultsCountChanged;
@end

The ProceduralDelegateImplForSearch.m File

#import "ProceduralDelegateImplForSearch.h"
@implementation ProceduralDelegateImplForSearch
// Returns number of search results
- (int) searchResultsCount
{
    return _resultsCount;
}
// Called on search finish
- (void) searchFinished
{
    // Display a message about finishing search in regular report in the development environment console
    NSLog(@"Search is finished");
}
// Resets search results
-(void) reset
{
    _resultsCount = 0;
}
// Called on finding match with specified string in regular report
-(void) resultsCountChanged
{
    // Increase values of variable for calculating the number of search results
    _resultsCount++;
}
@end

See also:

Calculation of Search Results Number by Regular Report