Instance Property

queryFragment

The search string for which you want completions.

Declaration

@property(nonatomic, copy) NSString *queryFragment;

Discussion

Assigning a string to this property initiates a search based on that string. The completer object waits a short amount of time before initiating new searches. This delay gives you enough time to update the search string based on typed input from the user. For example, if you are using a text field to manage the input from the user, you could use the textField:shouldChangeCharactersInRange:replacementString: method of the text field’s delegate to update the value of this property, as shown in the following example.

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range
         replacementString:(NSString *)string {
    self.completer.queryFragment = textField.text;
 
    return YES;
}

See Also

Specifying the Query Attributes

region

The region that defines the geographic scope of the search.

resultTypes

The types of search completions to include.

pointOfInterestFilter

A filter that lists point of interest categories to include or exclude in the search.

filterType

The filter options for the search results.

Deprecated
MKLocalSearchCompleterResultType

Options that indicate types of search completions.