Instance Method

findString:withOptions:

Synchronously finds all instances of the specified string in the document.

Declaration

- (NSArray<PDFSelection *> *)findString:(NSString *)string withOptions:(NSStringCompareOptions)options;

Discussion

Each hit gets added to an NSArray object as a PDFSelection object. If there are no hits, this method returns an empty array.

Use this method when the complete search process will be brief and when you don’t need the flexibility or control offered by beginFindString:withOptions:. For options, refer to Searching, Comparing, and Sorting Strings.

See Also

Searching Documents

- beginFindString:withOptions:

Asynchronously finds all instances of the specified string in the document.

- beginFindStrings:withOptions:

Asynchronously finds all instances of the specified array of strings in the document.

- findString:fromSelection:withOptions:

Synchronously finds the next occurance of a string after the specified selection (or before the selection if you specified NSBackwardsSearch as a search option.

isFinding

Returns a Boolean value indicating whether an asynchronous find operation is in progress.

- cancelFindString

Cancels a search initiated with beginFindString:withOptions:.